Skip to content

Instantly share code, notes, and snippets.

@cockscomb
cockscomb / tags.m
Created December 4, 2012 10:31 — forked from anonymous/Only prints query once
Prints Query 1
NSArray *tags = [all valueForKey:@"tag"];
NSMutableArray *adoptTags = [[NSMutableArray alloc] init];
for (NSString *tagQuery in tags) {
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"tag CONTAINS[cd] %@", tagQuery];
NSArray *roughArray = [all filteredArrayUsingPredicate:predicate];
NSArray *tagContent = [[NSSet setWithArray:roughArray] allObjects];
[adoptTags addObjectsFromArray:tagContent];
}
NSLog(@"Tags: %@", adoptTags);
@cockscomb
cockscomb / hackerrank.py
Created July 4, 2012 02:04
HackerRank Python Module
#!/usr/bin/env python
import urllib2
import json
import sys
import time
import multiprocessing
from cookielib import CookieJar
from urllib import urlencode
### Other 3rd party functions