Skip to content

Instantly share code, notes, and snippets.

@harmy
harmy / middleware.py
Created June 6, 2016 14:54 — forked from Miserlou/middleware.py
Django Profiler
# Orignal version taken from http://www.djangosnippets.org/snippets/186/
# Original author: udfalkso
# Modified by: Shwagroo Team and Gun.io
import sys
import os
import re
import hotshot, hotshot.stats
import tempfile
import StringIO
@harmy
harmy / elasticsearch-skyline.py
Created June 6, 2016 05:55 — forked from chenryn/elasticsearch-skyline.py
change etsy skyline to read metrics from elasticsearch directly.
import pandas
import numpy as np
import scipy
import statsmodels.api as sm
import os
import sys
import json
import traceback
import logging
from time import time
@harmy
harmy / it男的方子.txt
Last active May 8, 2016 13:47
酱牛肉食谱
作者:伍乐
链接:http://www.zhihu.com/question/21056162/answer/17872218
来源:知乎
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
具体步骤如下:
1、买牛肉:没错,买牛肉也有讲究,最好买牛腱子肉。有点筋头巴脑的,比较好吃,腱子肉的肉质比较适合酱。
2、泡牛肉:买回来以后,改刀成大块,然后放到清水里泡那么2个小时,把血水泡出来,这样做出来的牛肉没有腥味。当然,你泡长一点时间更好。最好每个小时换一次水。
@harmy
harmy / justinguitar.py
Created September 26, 2015 15:33 — forked from nhanb/justinguitar.py
Grabbing all lesson videos from justinguitar's beginner course
#!/usr/bin/env python
import requests
import re
from bs4 import BeautifulSoup
from subprocess import call, check_output
import string
def fetch_html(links):
@harmy
harmy / working_directory.py
Created June 9, 2015 17:24
A context manager which changes the working directory to the given path, and then changes it back to its previous value on exit.
@contextlib.contextmanager
def working_directory(path):
"""
A context manager which changes the working directory to the given
path, and then changes it back to its previous value on exit.
Original by Greg Warner:
http://code.activestate.com/recipes/576620-changedirectory-context-manager/#c3
"""
prev_cwd = os.getcwd()
os.chdir(path)
@harmy
harmy / exportCERT.sh
Last active August 29, 2015 14:10
exportCERT
#!/bin/sh
PROJECT_ROOT="$(pwd)/pvzsequel/proj.ios"
WORKSPACE="$PROJECT_ROOT/pvzsequel.xcodeproj/project.xcworkspace"
CONFIG="Release"
SCHEME="pvzsequel"
SDK="iphoneos"
TARGET="pvzsequel"
BUILDDIR="$PROJECT_ROOT/build"
OUTPUTDIR="$BUILDDIR/Release-$SDK"
@harmy
harmy / gist:eafa0f54988611167203
Created November 10, 2014 14:37
install jdk7 in ubuntu
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java7-installer
To automatically set up the Java 7 environment variables JAVA_HOME and PATH:
sudo apt-get install oracle-java7-set-default
@harmy
harmy / classmates.md
Last active August 29, 2015 14:01
classmates.md

长泰一中2000届高三1班通信录

姓名 电话 常住地 行业/单位
林丁锋 18759129591 长沙 通信
杨金坤 18059632999 长泰 建材水电
郑宝林 13600975176 龙岩 制冷设备
杨鹏林 13400631318 厦门 IT
张景辉
@harmy
harmy / oldbooks.md
Last active December 30, 2015 23:59
这些书准备出售

全部已出

@harmy
harmy / HideVirtualBox.bat
Created October 31, 2013 06:02
run games like mapstory or 梦幻西游 in virtualbox.
@echo off
@reg copy HKLM\HARDWARE\ACPI\DSDT\VBOX__ HKLM\HARDWARE\ACPI\DSDT\NOBOX__ /s /f
@reg delete HKLM\HARDWARE\ACPI\DSDT\VBOX__ /f
@reg add HKLM\HARDWARE\DESCRIPTION\System /v SystemBiosVersion /t REG_MULTI_SZ /d "NOBOX - 1" /f
@exit