I hereby claim:
- I am jdelstrother on github.
- I am jdelstrother (https://keybase.io/jdelstrother) on keybase.
- I have a public key ASAS4qH7bLsSpwWyxAbW3yYMGOalcNXaqew6aoYzQjp7rQo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
| CATEGORIES = [ | |
| "Sports", | |
| "Entertainment", | |
| "Comedy", | |
| "News & Politics", | |
| "Business", | |
| "Society & Culture", | |
| "Technology", | |
| "Health & Fitness", | |
| "en Español", |
| function secondsToHoursMinutesSeconds(totalSec) { | |
| totalSec = Math.round(totalSec) | |
| var hours = Math.floor(totalSec / 3600) % 24 | |
| totalSec -= hours * 3600 | |
| var minutes = Math.floor(totalSec / 60) % 60 | |
| totalSec -= minutes * 60 | |
| return padToTwo(hours) + ':' + padToTwo(minutes) + ':' + padToTwo(totalSec) | |
| } | |
| // 3000 -> "50:00" |
| var Promise = require('bluebird') | |
| var a = Promise.reject(new Error('load failed')).delay(100) | |
| var b = Promise.resolve(123).delay(50) | |
| var queue = [a,b] | |
| function processQueue() { | |
| var next = queue.shift() | |
| if (next) { | |
| return next.catch(processQueue) | |
| } else { |
| # Stuff with obvious replacements: | |
| image_science, rmagick => mini_magick (not a drop-in replacement) | |
| mysql2 => activerecord-jdbc-adapter, jdbc-mysql | |
| unicorn => puma | |
| # Stuff that we only use because they're optimized: | |
| hiredis | |
| yajl-ruby => json |
| int main(int argc, char * argv[]) | |
| { | |
| DrawInfo* info = AcquireMagickMemory(sizeof(*info)); | |
| GetDrawInfo(NULL, info); | |
| DestroyDrawInfo(info); | |
| return 0; | |
| } |
| $ gcc -I/ec/include/ImageMagick-6/ -L/ec/lib -lMagickCore-6.Q16 ./magick.c | |
| $ UMEM_DEBUG=default,audit,verbose ./a.out | |
| umem allocator: redzone violation: write past end of buffer | |
| buffer=8103bc0 bufctl=8106a58 cache: umem_alloc_640 | |
| previous transaction on buffer 8103bc0: | |
| thread=1 time=T-0.000636133 slab=8105f98 cache: umem_alloc_640 | |
| libumem.so.1'umem_cache_alloc_debug+0x1fe | |
| libumem.so.1'umem_cache_alloc+0x18f | |
| libumem.so.1'umem_alloc+0x50 | |
| libumem.so.1'malloc+0x36 |
| DrawInfo* info = malloc(sizeof(*info)); | |
| GetDrawInfo(NULL, info); | |
| DestroyDrawInfo(info); |
| @interface Person : NSObject | |
| @property NSString* firstName, *lastName; | |
| -(NSString*)fullName; | |
| @end | |
| @implementation Person | |
| + (NSSet *)keyPathsForValuesAffectingFullName { | |
| return [NSSet setWithObjects:@"lastName", @"firstName", nil]; | |
| } |
| __block NSManagedObjectID objectID = nil; | |
| [moc performBlockAndWait: ^{ | |
| NSManagedObject* object = findOrCreateSomethingSpecial(moc); | |
| objectID = object.objectID; | |
| }]; | |
| dispatch_async(dispatch_get_main_queue(), ^{ | |
| doSomethingWith(objectID); | |
| }); |