I hereby claim:
- I am jonalmeida on github.
- I am jonalmeida (https://keybase.io/jonalmeida) on keybase.
- I have a public key whose fingerprint is 831C F54A 918F 0986 6E4A 7E59 1DB0 4496 F117 C452
To claim this, I am signing this object:
| function wait(callback, delay){ | |
| var startTime = new Date().getTime(); | |
| while (new Date().getTime() < startTime + delay); | |
| callback(); | |
| } |
| setTimeout( | |
| function(){ | |
| console.log(document.getElementById("list").children[i]); | |
| setTimeout( | |
| function(){ | |
| console.log(document.getElementById("list").children[i]); | |
| }, 2000); | |
| }, 2000); |
| var items=[1,2,3]; | |
| foo = function(items, 1000){ | |
| bar = function(items[0]); | |
| setTimeout( function(){ | |
| foo(items.slice(1), 1000 | |
| }, 1000) | |
| } |
| #!/bin/env python | |
| for x in xrange(1, 101): | |
| # Calculate once, refer to the results again instead of re-calculating | |
| isFive = (x%5 == 0) | |
| isThree = (x%3 == 0) | |
| if(isFive & isThree): | |
| print "CracklePop" | |
| elif(isFive): | |
| print "Pop" |
I hereby claim:
To claim this, I am signing this object:
| - (void) sendPostData:(NSDictionary *)data withDbIndexArray:(NSMutableArray *)dbIndexArray { | |
| AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
| manager.requestSerializer = [AFJSONRequestSerializer serializer]; | |
| [manager POST:[_urlEndpoint absoluteString] parameters:data success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
| NSLog(@"JSON: %@", responseObject); | |
| [_dbQueue inDatabase:^(FMDatabase *db) { | |
| for (int i=0; i < dbIndexArray.count; i++) { | |
| NSLog(@"Removing event at index: %@", dbIndexArray[i]); | |
| [_db removeEventWithId:[[dbIndexArray objectAtIndex:i] longLongValue]]; |
This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.
The script is here:
#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"
| set ffs=unix,dos,mac " set file formats | |
| set number " line numbers | |
| set background=dark " background | |
| colorscheme vividchalk " theme | |
| "colorscheme molokai | |
| "let g:molokai_original = 1 | |
| call pathogen#incubate() | |
| call pathogen#helptags() | |
| filetype off | |
| syntax on |
| #include <iostream> | |
| #include <string> | |
| #include <inttypes.h> | |
| int main( int argc, char *argv[] ) { | |
| uint64_t h = 25180466553932; | |
| std::string letters = "acdegilmnoprstuw"; | |
| std::string answer = ""; |