Skip to content

Instantly share code, notes, and snippets.

View ratazzi's full-sized avatar

Ratazzi ratazzi

View GitHub Profile
# Example ncurses program that should print all combinations of foreground
# color on background color but doesn't work.
# Make your terminal 256 characters wide for best view.
require 'rubygems'
require 'ncurses'
screen = Ncurses.initscr
Ncurses.noecho
Ncurses.cbreak
@defunkt
defunkt / clients.md
Created April 18, 2010 14:09
A list of Gist clients.

Gist Clients

Want to create a Gist from your editor, the command line, or the Services menu? Here's how.

Editor Support

#!/usr/bin/env python
# encoding: utf-8
"""
Usage:
fab deploy:appname
"""
from fabric.api import env, run, cd, local, put
env.hosts = ['myserver.com']
env.user = 'eric'
@huacnlee
huacnlee / mencoder covert video for iOS and Android
Created October 20, 2010 03:36
使用 Mencoder 将视频转换为支持iOS和Android的H.264视频格式
$ sudo apt-get install mencoder
$ mencoder origin.mp4 -o new.mp4 -vf dsize=480:360:2,scale=-8:-8,harddup \
-oac faac -faacopts mpeg=4:object=2:raw:br=128 \
-of lavf -lavfopts format=mp4 -ovc x264 -sws 9 \
-x264encopts nocabac:level_idc=30:bframes=0:bitrate=512:threads=auto:turbo=1:global_header:threads=auto:subq=5:frameref=6:partitions=all:trellis=1:chroma_me:me=umh
@Machx
Machx / Blackboard.dvtcolortheme
Created February 4, 2011 20:02
Blackboard theme from TextMate for Xcode 4
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>
@jie
jie / session.py
Created May 24, 2011 07:56
a gae session
import os
import time
import datetime
import random
import Cookie
import logging
from google.appengine.api import memcache
COOKIE_NAME = 'appengine-session-sid'
DEFAULT_COOKIE_PATH = '/'
@wileywimberly
wileywimberly / add2readinglist.scpt
Created August 1, 2011 21:27
Automator Service - Add to Reading List - lax version
--
-- Automator Service - Add to Reading List - lax version
--
-- http://warmfuzzyapps.com/2011/07/add-to-reading-list-lax-version/
-- Wiley Wimberly <[email protected]>
--
-- The default service that adds links to Safari's Reading List is a
-- bit on the strict side when deciding what constitutes a URL and it
-- doesn't work well for adding shortened URLs from apps like twitter.
-- This version is more tolerant and will prepend http:// if the
anonymous
anonymous / t.py
Created September 15, 2011 15:13
import threading
import time
def bug(num):
while 1:
print "bug!^C may not work!thread-%d"%num
time.sleep(1)
threads=[]
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@nesquena
nesquena / linode_fog.rb
Created October 28, 2011 09:24
Linode and Fog Samples
## DNS
@dns = Fog::DNS.new(:provider => 'Linode', :linode_api_key => LINODE_KEY)
if @zone = @dns.zones.all.find { |z| z.domain == ZONE }
puts "Found zone #{@zone.inspect}"
else
@zone = @dns.zones.create(:domain => ZONE, :email => ZONE_EMAIL)
puts "Creating zone #{@zone.inspect}"
end