Skip to content

Instantly share code, notes, and snippets.

View sparanoid's full-sized avatar
⚠️
undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined

sparanoid

⚠️
undefinedundefinedundefinedundefinedundefinedundefinedundefinedundefined
View GitHub Profile
@serco-chen
serco-chen / xiaobao.rb
Created June 7, 2014 07:45
Xiaobai Toothbrush
class A1 # A1 声波牙刷
FEATURES = [
"五档位调节, 20000 ~ 36000 次/分钟;",
"2分钟自动关闭, 档位记忆, 下次使用自动进入上一次选择档位;",
"感应式充电,一次充电可稳定使用30次以上;",
"标配4个可更换刷头"
]
@@questions = ["使用方法", "清洁方法", "保修电话"]
@DataWraith
DataWraith / polipo_cache_clean.zsh
Created May 7, 2010 19:11
Script to clean Polipo's cache once free space runs low
#!/bin/zsh
# This script deletes the least-recently used (LRU) files from Polipo's cache
# once the partition it is on has less than $min_disk_free Bytes of free space
# left.
#
# It's meant to be used as a cron job, and it's a little more complicated than
# it needs to be, because I wrote it mostly to learn zsh.
local cache_dir="/var/cache/polipo/"
@rpetrich
rpetrich / index.php
Created October 14, 2010 21:52
Twitter self-hosted image service/url shortener
<?
// Twitter self-hosted image service/url shortener by Ryan Petrich
// Installation:
// 1. Paste this script into the top of your HTTP root's index.php (rename index.html to index.php if it doesn't exist)
// 2. Add the following to your HTTP root's .htaccess file (create .htaccess if it doesn't exist):
// ErrorDocument 404 /index.php
// 3. Create a "s" subfolder and give it 777 permissions
// 4. Add the following as the custom URL for URL shortening in Twitter for iPhone's settings:
// http://yourdomain.com/?d=%@&p=password
// 5. Add the following as the custom URL for Image service:
@jimeh
jimeh / DefaultKeyBinding.dict
Created January 9, 2012 15:44
More Emacs-friendly keybindings in Cocoa Apps.
/* ~/Library/KeyBindings/DefaultKeyBinding.dict */
{
/* Additional Emacs bindings */
"~f" = "moveWordForward:"; /* M-f */
"~b" = "moveWordBackward:"; /* M-b */
"~<" = "moveToBeginningOfDocument:"; /* M-< */
"~>" = "moveToEndOfDocument:"; /* M-> */
"~v" = "pageUp:"; /* M-v */
"^v" = "pageDown:"; /* C-v */
@gpluess
gpluess / README.md
Created February 22, 2012 12:52
IE6 patch for the Twitter Bootstrap grid system

These patches provide basic support for the Bootstrap grid system in Internet Explorer 6. The JavaScript code requires jQuery.

Feel free to fork & improve.

@andynu
andynu / generate_glyphicons_pro_css.rb
Created May 14, 2012 15:28
Generate css for Glyphicons Pro.
#!/usr/bin/env ruby
#
# Generate css for the pro glyphicons.
# Run this script in the glyphicons_pro/glyphicons/png folder
# from the purchased zip file.
#
# see http://glyphicons.com/ for purchase/license information.
#
render = (ARGV.include? "--html") ? :html : :css
@hcooper
hcooper / ciphertest.sh
Created September 6, 2012 11:09
Report what ciphers are support by a given host (using openssl)
#!/usr/bin/env bash
# ciphertest.sh
# Hereward Cooper <coops@fawk.eu> - 6th Sept 2012
# Report what ciphers are support by a given host
# Modifed from code found here: http://superuser.com/questions/109213/
# Do we want to pause between each cipher?
DELAY=0
/**
* Server Side
*/
var players = [];
var count = 0;
sails.io.on('connection', function (socket) {
var player = {};
socket.on('register', function (uuid) {
@Vestride
Vestride / Cleanup Layer Comps.jsx
Created July 5, 2012 02:02
Photoshop layer comp cleanup script
/**
* Photoshop layer comp cleanup script
*
* This script will run through all the layer comps, find layers that are hidden in every comp
* as well as any groups that are empty and delete them. Save before doing this just in case ;)
*
* @author Glen Cheney (http://glencheney)
* @version 1.1
* @date 7.10.12
*/
@luikore
luikore / space_en_ch.rb
Created June 13, 2013 17:24
textmate command to add space between english and chinese
#! /usr/bin/env ruby
str = $stdin.read
if RUBY_VERSION < '1.9'
print str
exit
end
str.force_encoding 'utf-8'
str.gsub! /(\p{Han})([a-zA-Z0-9\(\)\[\]\{\}])/u do
"#$1 #$2"