I hereby claim:
- I am nonsensery on github.
- I am nonsensery (https://keybase.io/nonsensery) on keybase.
- I have a public key whose fingerprint is 6A2B FAF8 5423 68A8 3CCE C636 4700 6A0A 0843 3A5D
To claim this, I am signing this object:
objc_try_catch({ | |
let exception = NSException(name: "Something went wrong", reason: "not sure", userInfo: [:]) | |
print("raising NSException: \(exception)...") | |
exception.raise() | |
}) { exception in | |
print("... caught NSException: \(exception)") | |
} |
'use strict' | |
window.bigHeads = window.bigHeads || (function(window, document){ | |
var edgePadding = 10 | |
function makeRect(top, right, bottom, left) { | |
return { top, right, bottom, left, width: (right - left), height: (bottom - top) } | |
} | |
function ftosMaxChars(f, maxChars) { |
/* | |
Sometimes in a group hangout, it's nicer to see everyone all the time, | |
rather than just the person who is currently "speaking". | |
The solution is to click on your own thumbnail (so that you are always | |
the "speaker"), and then zoom and pan the page content so that the | |
thumbnails fill the whole width of the window. This can be done pretty | |
easily by applying `translate` and `scale` `transform`s to the body | |
element. |
var bigInt = require('big-integer'); | |
/** | |
* @class Grains | |
* | |
* Computes the number of grains on the squares of a | |
* chess board, starting with one grain on the first | |
* square, and doubling with each successive square. | |
*/ | |
function Grains() { |
class Post extends React.Component { | |
render() { | |
return ( | |
<article> | |
<h2>{this.props.title}</h2> | |
<section>{this.props.children}</section> | |
</article> | |
); | |
} | |
} |
I hereby claim:
To claim this, I am signing this object:
Here's a pattern I've used for creating unique "singleton" records.
Given a desired tag name, name
, and managed object context, context
,
context
, fetch all Tag objects with the desired name, ordered ascending by primary key.tempContext
.newTag
, and save changes.tempContext
).Here's one way that a sync system could support signing in-to and out-of different server-side sync accouts.
I'm going to consider every note on every device to be unique, initially, since the only way to have duplicate notes would be to have manually copied them between devices.
Since each local note is unique at this point, signing in to a sync account for the first time just adds all of the local notes to that sync account, and records the unique id assigned by the server (keeping the local unique id as well). The sync account "owns" these notes now, and they will appear on any device that signs in to that account.
Other notes from the sync account are downloaded to the device. Each of these gets a local unique id, just like it had been created on the device (and it keeps the server-assigned id).
Some thoughts on this blog post by Brent Simmons
From the original:
A VSNote has more than a dozen properties. But the timeline needs only a few of those, and there would be performance and memory-use gains by using a smaller object. … In Core Data I could create two entities: VSTimelineNote and VSExtendedNote. VSTimelineNote would have a to-one relationship to VSExtendedNote. … [But that] means the data isn’t stored using the most natural representation. The data model would be based on the needs of the UI, which is not a good idea.
Putting aside Core Data for a moment, at issue is that each VSNote contains 8 or 10 attributes that are not needed to display the master list of notes; they are only needed to display the detail view for a note. Ideally, when displaying the list, we could load just the attributes used in the list into memory, and then load the rest when displaying the detail view. But realistically, a few bytes for a timestamp here