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
(gdb) po mSavedInvocation | |
Some day, NSInvocation will have a useful debug description |
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
include Dispatch | |
class Future | |
def initialize(&block) | |
@@queue_count ||= 0 | |
Thread.current[:futures_queue] ||= Queue.new("org.macruby.futures-#{Thread.current.object_id}") | |
@group = Group.new | |
Thread.current[:futures_queue].async(@group) { @value = block[] } | |
end | |
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
#define MIN_PASTE(A,B) A##B | |
#define MIN_IMPL(A,B,L) ({ __typeof__(A) MIN_PASTE(__a,L) = (A); __typeof__(B) MIN_PASTE(__b,L) = (B); MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) : MIN_PASTE(__b,L); }) | |
#define MIN(A,B) MIN_IMPL(A,B,__COUNTER__) |
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
git remote add -f tp file:///Volumes/Sources/tp.git/ | |
INITIAL_COMMIT=`git rev-list tp/master --reverse | head -n1` | |
git checkout -b nb-merge | |
for MCH in `git rev-list --reverse $INITIAL_COMMIT..tp/master` | |
do | |
git merge --squash -s subtree --no-commit $MCH && git commit -C $MCH | |
done | |
git filter-branch --msg-filter "sed 's/^/[new-branch] /'" master..HEAD | |
git svn branch new-branch -m "[new-branch] Creating branch." | |
git rebase refs/remotes/new-branch |
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
#define is_signed(T) ({ intmax_t __s = -1; T __t = (T)__s; __t < 0; }) | |
#define maxofint(T) (is_signed(T) == 0 ? \ | |
((uintmax_t)1 << (sizeof(T) * 8)) - 1 : \ | |
((uintmax_t)1 << (sizeof(T) * 8 - 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
#!/bin/bash | |
encode() { | |
local data | |
OLDIFS="${IFS}"; IFS="" | |
read -d "" data | |
IFS="${OLDIFS}" | |
echo -n $(echo -n "$data" | wc -c) | |
echo -n ":$data" | |
echo -n "," |
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 __has_extension(c_generic_selections) && __has_extension(c_static_assert) | |
#import "EvilCastImpl.h" | |
// Returns the value of s, clamping it to the bounds of type t. s and d must either both be integers | |
// or both be floating-point values. | |
#define EvilBoundedCheckedCast(t, s) __EvilChecked(t, s, Cast) | |
// Tries to assign the value of s to d, returning 1 if s is within the bounds of s and 0 if not. | |
// s and d must either both be integers or both be floating-point values. | |
#define EvilCheckedAssign(d, s) __EvilChecked(d, s, Assign) | |
#else |
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
#!/bin/bash | |
# tarripper | |
# takes a tar file on stdin | |
# outputs a sha256 catalog of the tar file on stout | |
# | |
# public domain | |
set -e | |
while true; do |
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
#define raw_paste(...) #__VA_ARGS__ | |
#define raw_fix(...) raw_paste(__VA_ARGS__) | |
#define raw_join(x,y) x##y | |
#define raw_str_h(z, ...) ({char *raw_join(__raw_x, z) = raw_fix(raw_paste(__VA_ARGS__)); [[[NSString alloc] initWithBytes:raw_join(__raw_x, z) + 1 length:strlen(raw_join(__raw_x, z)) - 2 encoding:NSUTF8StringEncoding] autorelease];}) | |
#define raw_str(...) raw_str_h(__COUNTER__, __VA_ARGS__) | |
/* totally doesn't work with embedded single or double quotes */ | |
@import Foundation; | |
int main(int argc, char **argv) { |
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
Phone | |
30 minute simple tech screen | |
45 minute manager info about job team company and answer questions | |
30 minute talk about a project you've done | |
Make decision to interview | |
In person with coworkers | |
45–60 minute portfolio/presentation (avoids resume questions in other sessions) | |
90 minutes coding project with a partner answering questions and helping |