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
# -*- coding: utf-8 -*- | |
# | |
# | |
def get(url, &block) | |
@url ||= Hash.new do |hash, key| | |
hash[key] = block | |
end |
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
# -*- coding: utf-8 -*- | |
require 'nokogiri' | |
require 'open-uri' | |
require 'sqlite3' | |
$db = SQLite3::Database.new "words.db" | |
begin | |
rows = $db.execute <<-SQL | |
create table words ( |
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
/tmp % cat env.c | |
#include <stdlib.h> | |
#include <stdio.h> | |
int | |
main(int argv, char **args) { | |
printf("%s", getenv("PATH")); | |
} | |
/tmp % llvm-gcc -o env env.c | |
/tmp % ./env |
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
FFD8FF=JPEG(jpg) | |
89504E47=PNG(png) | |
47494638=GIF(gif) | |
49492A00=TIFF(tif) | |
424D=Windows\ Bitmap(bmp) | |
41433130=CAD(dwg) | |
38425053=Adobe\ Photoshop(psd) | |
7B5C727466=Rich\ Text\ Format(rtf) | |
3C3F786D6C=XML(xml) | |
68746D6C3E=HTML(html) |
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
public class a { | |
public static void main(String[] args){ | |
System.out.println("polygenelubricants".hashCode()); //-2147483648 | |
} | |
} |
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
unsigned int RSHash(char* str, unsigned int len) | |
{ | |
unsigned int b = 378551; | |
unsigned int a = 63689; | |
unsigned int hash = 0; | |
unsigned int i = 0; | |
for(i = 0; i < len; str++, i++) | |
{ | |
hash = hash * a + (*str); | |
a = a * b; |
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
# -*- coding: utf-8 -*- | |
class Resource(object): | |
pass | |
class API(object): | |
pass | |
class V1(API): | |
version = 1 |
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
# -*- coding: utf-8 -*- | |
from flask import Flask, make_response | |
from flask.ext.restful import Api, Resource | |
import json | |
app = Flask(__name__) | |
api = Api(app) | |
RESOURCE = { |
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
# -*- coding: utf-8 -*- | |
from flask import Flask, request | |
from flask.ext.restful import Resource, Api | |
from flask.ext.restful import reqparse | |
app = Flask(__name__) | |
api = Api(app) | |
class Progress(Resource): |
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
function zle-line-init zle-keymap-select { | |
zle reset-prompt | |
} | |
zle -N zle-keymap-select | |
bindkey -v | |
bindkey ',l' history-incremental-search-backward |
OlderNewer