- 100g extra firm tofu
- 4-5 pieces garlic
- small piece ginger
- 3 sticks green onion
- 3 tbsp avocado oil
- 3 tsp dark soy sauce
- 150g knife pare noodles
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (myOptionalThing.isPresent()) { | |
myOptionalThing.get().doSomething(); | |
} | |
// vs | |
myOptionalThing.ifPresent(MyOptionalThing::doSomething); | |
// vs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static boolean isPresent(final Optional<?> ... optionals) { | |
for (final Optional<?> optional : optionals) { | |
if (!optional.isPresent()) { | |
return false; | |
} | |
} | |
return optionals.length > 0; | |
} |
I hereby claim:
- I am harukizaemon on github.
- I am haruki_zaemon (https://keybase.io/haruki_zaemon) on keybase.
- I have a public key whose fingerprint is F16A BCF7 8D71 631E 4810 8091 FCFC 89CE 3725 4EF6
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
assertThat\((.*), is\((.*)\)\); | |
assertEquals($2, $1); | |
assertThat\((.*), nullValue\(\)\); | |
assertNull($1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TODO: Using the main context as the parent of the background context works | |
// fantastically on the iPhone 5 but not so much on the 4 where it takes | |
// too much processing from on the main thread and makes it jerky and | |
// unresponsive. Same goes for merging changes the old-fashioned way. | |
// | |
// As a compromise, we use old-fashioned merging but only deletions, as | |
// these would otherwise cause the main context to barf if/when trying | |
// to save an object that was deleted in the background. *phew* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)performUsingBlock:(void (^)(NSManagedObjectContext *context))block { | |
[self performBlock:^{ | |
block(self); | |
}]; | |
} | |
- (void)performUsingBlockAndWait:(void (^)(NSManagedObjectContext *context))block { | |
[self performBlockAndWait:^{ | |
block(self); | |
}]; |
I have a facade over an asynchronous network call—that also performs pagination, ie multiple network calls in order to handle very large result sets—along the lines of this but I now want to use it in a context where knowing when it's finished iterating is important (e.g in an NSOperation
):
[enumerateFoosAtURL:URL usingBlock:^(id foo, BOOL *stop) {
...
} failure:^(NSError *error) {
...
}];
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (id)initWithCoder:(NSCoder *)coder { | |
self = [super initWithCoder:coder]; | |
if (self) { | |
[self addSubview:[[[NSBundle mainBundle] loadNibNamed:NSStringFromClass([self class]) owner:self options:nil] objectAtIndex:0]]; | |
} | |
return self; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Employed persons by detailed occupation, sex, race, and Hispanic or Latino ethnicity: | |
ftp://ftp.bls.gov/pub/special.requests/lf/aat11.txt | |
Google searches for articles relating to gender imbalance in various professions: Literally google searches for "gender imbalance in <profession>" | |
accounting = 303,000 | |
nursing = 192,000 | |
teaching = 503,000 | |
policing = 261,000 |
NewerOlder