Skip to content

Instantly share code, notes, and snippets.

- (UIImage *)screenshotBlurred {
UIImage *blurItemImage = [self.screenshot stackBlur:25];
return blurItemImage;
}
- (UIImage *)screenshot {
CGRect rect = [self bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[self.layer renderInContext:context];
<?php
$base = "https://www.lootsy.com/api/1.2/catalog?tag=%24f&beforeId=";
$ids = [];
$items = [];
do {
$beforeId = empty($ids) ? "" : end($ids);
$url = $base . $beforeId;
echo "$url\n";
self.manager!.GET("https://itunes.apple.com/search",
parameters: ["term": searchBar.text],
success: { (operation: AFHTTPRequestOperation!,responseObject: AnyObject!) in
println("JSON: " + responseObject.description)
},
failure: { (operation: AFHTTPRequestOperation!,error: NSError!) in
println("Error: " + error.localizedDescription)
})
// a sample representation of a user in Cassandra
usersTable = { // table for user data
'phatduckk' : { // row w/ key "phatduckk"
'addresses' : { // column family of type "Super"
"work" : { "street" : "12345 Main street", 'city': "San Francisco", "state" : "CA", "zip": "90210" }, // column family
"home" : { "street" : "7 Foobar street", 'city': "San Mateo", "state" : "CA", "zip": "94666" } // column family
},
'socialNetworks' : { // column family of type "Super"
"com.digg" : {"url" : "http://digg.com/users/phatduckk", "rss": "http://digg.com/users/phatduckk"}, // column family
// Pageview/click analytics in Cassandra?
pageAnalytics = {
"come.foo/index.html" : { // super column family
"pageviews": { // Super Column family
"someuuid" : {"cookie": "OH HAI", "url": "come.foo/index.html", "layout": 47, "ip": "1.2.3.4"},
"someuuid2" : {"cookie": "OH HAI", "url": "come.foo/index.html", "layout": 47, "ip": "1.2.3.4"},
},
"clicks": { // Super Column family
"someuuid" : {"cookie": "OH HAI", "target": "http://interiorcrocodilealligator.com/", "layout": 47, "ip": "1.2.3.4", "x" : 120, "y": 375},
CFLAGS="-arch x86_64" \
./configure \
--with-apxs2=/usr/sbin/apxs --prefix=/usr/local/php5.2.8 --with-config-file-scan-dir=/usr/local/php5.2.8/php.d \
--with-config-file-path=/usr/local/php5.2.8/php.d \
--disable-posix \
--enable-cli \
--with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config \
--with-jpeg-dir=/opt/local/include --with-png-dir=/opt/local/include --enable-gd-native-ttf --with-freetype-dir=/usr/local/php5.2.8 \
--with-zlib \
--enable-pdo --with-pdo-sqlite --with-sqlite=shared --enable-sqlite-utf8 \
<?php
$ch = curl_init("http://phatduckk.com");
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$res = curl_exec($ch);
$info = curl_getinfo($ch);
echo "final url: {$info['url']}\n";
-Dcassandra -Dstorage-config=conf -Dcassandra-foreground
Arin@arin Cassandra{arin}$ nosetests
EFEFEEEEEFEEEFEEEFEFEFEFEFEFEEEEEEEEFEFEFE
======================================================================
ERROR: system.test_server.TestMutations.test_bad_calls
----------------------------------------------------------------------
Traceback (most recent call last):
File "/opt/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/case.py", line 367, in tearDown
try_run(self.inst, ('teardown', 'tearDown'))
File "/opt/local/lib/python2.5/site-packages/nose-0.11.1-py2.5.egg/nose/util.py", line 487, in try_run
return func()
Arin@arin cassandra-trunk$ ls
BUGS.txt bin junitvmwatcher2676273624541453260.properties
CHANGES.txt build lib
DISCLAIMER.txt build.xml src
LICENSE.txt conf test
NOTICE.txt interface
README.txt junit3247500251065907469.properties
Arin@arin cassandra-trunk$ nosetests
.FFEEEEFEEEFEFF.EEEEEE
======================================================================