Skip to content

Instantly share code, notes, and snippets.

@yunnysunny
yunnysunny / .gitignore
Last active August 29, 2015 14:05
百度搜索引擎死链获取工具
/.settings
/.jshintrc
/.project
/*.txt
/*.xml
/*.bat
@scottjad
scottjad / Rakefile.diff
Created September 27, 2011 06:59
Octopress Rakefile changes to support org-mode
@@ -20,9 +20,10 @@ blog_index_dir = 'source' # directory for your blog's index pa
deploy_dir = "_deploy" # deploy directory (for Github pages deployment)
stash_dir = "_stash" # directory to stash posts for speedy generation
posts_dir = "_posts" # directory for blog files
+org_posts_dir = "org_posts"
themes_dir = ".themes" # directory for blog files
-new_post_ext = "markdown" # default new post file extension when using the new_p
-new_page_ext = "markdown" # default new page file extension when using the new_p
+new_post_ext = "org" # default new post file extension when using the new_post t
+new_page_ext = "org" # default new page file extension when using the new_page t
@st63jun
st63jun / pychecker.rb
Created September 30, 2011 09:56
Homebrew formula: pychecker
require 'formula'
class Pychecker < Formula
url 'http://downloads.sourceforge.net/project/pychecker/pychecker/0.8.19/pychecker-0.8.19.tar.gz'
homepage 'http://pychecker.sourceforge.net/'
md5 'c37182863dfb09209d6ba4f38fce9d2b'
def install
system "python", "setup.py", "install",
"--prefix=#{prefix}",
@Swop
Swop / Screencast to GIF file
Last active December 11, 2015 10:48
Simple steps to create a GIF from a screencast (OSX but works with Linux)
# Install ffmepg (for the screencast) & imagemagick (to optimize the GIF file for web usage)
brew install ffmpeg
brew install imagemagick
# Make the screencast and compress it
ffmpeg -i ScreenFlow.mov -pix_fmt rgb24 output.gif
convert -layers Optimize output.gif output_optimized.gif
# Upload it somewere in the cloud...
# ... and use the file in the desire website. Here's the markdown syntax:
@ngn999
ngn999 / zhoubao.md
Last active December 15, 2015 07:19
周报模板
定义一个 markdown-mode下的 snippet
<pre>
# -*- mode: snippet -*-
# name: zhoubao
# key: zhoubao
# binding: C-c C-n
# --
## ${1:#你的名字#}周报
`(concat "__" (yesterday-is 1) " ~ " (tommorow-is 5) "__")`
class BaseHandler(tornado.web.RequestHandler):
# ...
@tornado.gen.coroutine
def verify_place_something(self):
motor_db = self.settings['motor_db']
cursor = motor_db.places.find(
package net.colaborativa.exampleapp.api;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
@zengjie
zengjie / tornado-plupload.py
Created September 20, 2011 02:39
plupload tornado backend demo
import tornado.web
import tornado.ioloop
import logging
import os.path
def clean_filename(filename):
i = filename.rfind(".")
if i != -1:
filename = filename[0:i] + filename[i:].lower()
@petehamilton
petehamilton / hashcrack.rb
Created February 11, 2013 17:16
Ruby md5 passw3ord cracker. Brute force, character product, recursive yielding and base-n techniques
#! /usr/env/ruby
require "benchmark"
require 'digest/md5'
# The password hash to crack
password_hash = "e1f3ecc31656795a128db19da490c9ec"
# Helper for hashing passwords
def md5(password)
Digest::MD5.hexdigest(password)
@border
border / stock5Min.c
Created January 8, 2012 15:15
通达信股票天和5分钟数据格式分析, 参考: http://alantop.5166.info/gpdatasoft/gpformat/gpformat.htm
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
struct stock5Min
{
unsigned short monthDay; // 月日
unsigned short hourMin; // 小时, 分钟