After struggling for some time with CIFilter documentation at work, I've been working on an app which can apply filters interactively for various inputs...
I've been working on a side project for better CIFilter documentation lately, and I decided this was as good of a time as any to try out RxSwift. We use reactive programming at work, but I haven't really been able to dig into it yet...
Another MacOS and another struggle through installing nokogiri. Most places online recommend using...
While building this site in Gatsby using MDX, I noticed that there wasn't any documentation on how to include data from the frontmatter of an MDX document in the document's page layout...
I use Gatsby as a static site generator to build this blog using React. As part of this, I wanted a simple component to display a static image, something like this:
<Image filename="myimage.png" />
Surprisingly, this is hard to do in Gatsby. The default Image component generated by Gatsby uses StaticQuery
:
To clear a value from UserDefaults, I previously thought it was fine to do something like this:
UserDefaults.standard.set(nil, forKey: "myKey")
Turns out that this works differently in different iOS versions. Starting in iOS 11, setting nil for a key works as I expected.
There are some times in Swift, like when using System Trace, that you want to get the pointer value of an object directly as a UInt
(passing the pointer to kdebug_signpost
is one). I was surprised at how hard it was to find documentation on how to get a Swift reference’s pointer value as a UInt
.
Swift can be tricky sometimes. For example, what does the following print?
class A: NSObject {
let x: Int
init(x: Int) {
self.x = x
}
}
func ==(left: A, right: A) -> Bool {
return left.x == right.x
}
print(A(x: 1) == A(x: 1))
print([A(x: 1)] == [A(x: 1)])
Let's talk about syntax trees. In static analysis, a common operation is to take a character string (e.g. "x = 1") and transform it into well structured data. Let's try to do this in python. We'll use Pyparsing as our tokenization tool.
Ambitious, subject to change, incomplete, based on this.
1. Create something that touches 10,000 people. (January 20th, 2013) 2. Create something that touches 100,000 people. (January 14th, 2015) 3. Create something that touches 1,000,000 people.
Let’s talk about HTML tables. Here’s some code:
<table class="main">
<colgroup><col class="votes"><col></colgroup>
<tr>
<td>Votes</td>
<td>Comments</td>
</tr>
<tr>
<td>
<p class="vote-desc">Some long name, really long, like really super long</p>
<p class="vote-desc">Another long name, really long</p>
</td>
<td>
<p class="comment">A really, really, really, really, really really really really really, really long comment.</p>
</td>
</tr>
</table>