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
#!/usr/bin/env python | |
import shelve | |
import sys,os | |
import onetimepass as otp | |
def usage(): | |
print "myonetime <domain> <secret> : register secret" | |
print "myonetime <domain> : create one time password" |
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 json | |
import numpy as np | |
from sets import Set | |
with open("BusinessSpending.json") as f: | |
data = json.load(f, 'latin-1') | |
entries = data["raw_data"] | |
keys = [] | |
for entry in entries: | |
keys = entry.keys() |
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
from wordpress_xmlrpc import Client, WordPressPost | |
from wordpress_xmlrpc.methods.posts import NewPost | |
from wordpress_xmlrpc.methods import posts | |
import os.path | |
import sys | |
def read_config(filepath): | |
with open(filepath) as f: | |
lines = f.readlines() | |
return lines[0:3] |
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
for FILE in *.JPG; do mv $FILE `sha1sum $FILE | sed -e "s/ /_/g"`; done |
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
#include <stdio.h> | |
#include <stdlib.h> | |
#include "Perceptron.h" | |
#include <math.h> | |
const float c = 0.01; | |
Perceptron::Perceptron(int n) { | |
weights = new float[n]; | |
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 math | |
class MeanAndStddev: | |
def __init__(self): | |
self.values = []; | |
def append(self, val): | |
self.values.append(val * 1.0) | |
def mean(self): | |
sumValue = 0 | |
for a in self.values: |
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
morse = {".-":"A","-...":"B","-.-.":"C","-..":"D",".":"E","..-.":"F","--.":"G","....":"H","..":"I",".---":"J","-.-":"K",".-..":"L","--":"M","-.":"N","---":"O",".--.":"P","--.-":"Q",".-.":"R","...":"S","-":"T","..-":"U","...-":"V",".--":"W","-..-":"X","-.--":"Y","--..":"Z",".----":"1","..---":"2","...--":"3","....-":"4",".....":"5","-....":"6","--...":"7","---..":"8","----.":"9","-----":"0"} | |
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(){ | |
function startRotate() { | |
$("#reload").css("-webkit-animation-name", "loadingRotate"); | |
$("#reload").css("-webkit-animation-duration", "1s"); | |
$("#reload").css("-webkit-animation-iteration-count","infinite"); | |
$("#reload").css("-webkit-animation-play-state", "running"); | |
} | |
function stopRotate() { | |
$("#reload").css("-webkit-animation-play-state", "paused"); |
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
#!/bin/bash | |
if ! [ -f $1] | |
then | |
touch $1 | |
fi | |
open -a /Applications/Sublime\ Text\ 2.app $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
At first, install xcode. | |
And execute following commands. | |
XXXXXX is revision number. | |
$ svn co http://src.chromium.org/svn/trunk/tools/depot_tools | |
$ export PATH=$PATH:`pwd`/depot_tools | |
$ gclient config http://src.chromium.org/svn/trunk/src | |
$ gclient sync --revision src@XXXXXX | |
$ cd src/ | |
$ GYP_GENERATORS=make GYP_DEFINES=mac_sdk=10.7 ./build/gyp_chromium |
NewerOlder