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
import mpt | |
import rocksdb | |
class DBWrap: | |
def __init__(self, db) -> None: | |
self.db = db | |
def __setitem__(self, key, value): | |
self.db.put(key, value) |
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
cd | |
mkdir -p .vim/ | |
cd ~/.vim/ | |
mkdir -p autoload/ | |
mkdir -p doc/ | |
mkdir -p plugin/ | |
curl -OL https://bitbucket.org/ns9tks/vim-fuzzyfinder/get/4.2.2.tar.gz | |
tar zxvf 4.2.2.tar.gz |
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
import sys | |
import web | |
urls = ('/web.py', 'source') | |
class source: | |
def GET(self): | |
web.header('Content-Type', 'text/python') | |
print open(sys.argv[0]).read() | |
web.run(urls) |
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
class TestHandler(tornado.web.RequestHandler): | |
def wordpress_logged_in(self): | |
wordpress_logged_in_cookie_key = "" | |
for i in self.cookies: | |
if i.startswith("wordpress_logged_in_"): | |
wordpress_logged_in_cookie_key = i | |
break | |
wordpress_logged_in_cookie_value = self.get_cookie(wordpress_logged_in_cookie_key) | |
wordpress_logged_in_cookie_value = urllib.unquote(wordpress_logged_in_cookie_value) |
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
package { | |
import Math; | |
import flash.display.MovieClip; | |
import flash.display.Stage; | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.events.EventDispatcher; |
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
//.h file | |
@interface NavigationBar : UINavigationBar { | |
} | |
- (void)drawRect:(CGRect)rect; | |
@end | |
//.m file |
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
-(id) init | |
{ | |
if( (self=[super init] )) { | |
CGSize size = [[CCDirector sharedDirector] winSize]; | |
CCTexture2D *bg = [[CCTexture2D alloc] initWithImage:[UIImage imageNamed:@"Default.png"]]; | |
CCSprite *staticBackground0 = [CCSprite spriteWithTexture:bg]; | |
staticBackground0.position = ccp(-size.width/2,size.height/2); | |
CCSprite *staticBackground1 = [CCSprite spriteWithTexture:bg]; | |
staticBackground1.position = ccp(size.width/2,size.height/2); |