This file contains hidden or 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 setState(el, state) { | |
var d = 'disabled' | |
, $el = $(el) | |
, data = $el.data() | |
state = state + 'Text' | |
data.resetText || $el.data('resetText', $el.html()) |
This file contains hidden or 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
def fibonacci(n) | |
a,b = 0, 1 | |
n.times do | |
a,b = b,a+b | |
end | |
b | |
end | |
puts fibonacci(40) |
This file contains hidden or 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 sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
This file contains hidden or 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
Sub Word2Textile() | |
' | |
' Word2Textile Macro | |
' Macro created 7/18/11 by Jim Syler, [email protected] | |
' Modified from Word2MediaWiki, <http://www.infpro.com/Word2MediaWiki.aspx> | |
' Textile format information available at <http://redcloth.org/hobix.com/textile/> | |
' copied from http://pastebin.com/4GUetmBd, Ref to http://www.obsidianportal.com/campaign/sydarksun/wikis/word-to-textile-conversion | |
' | |
Application.ScreenUpdating = False |
This file contains hidden or 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
# Process AJAX request generated by jquery datatables plugin, prepare an object which contains information to be used in | |
# ActiveRecord operation, result object properties tbd | |
def decode_datatables_req | |
cols_count = params['iColumns'].to_i | |
row_start = params['iDisplayStart'].to_i | |
rows_per_page = params['iDisplayLength'].to_i | |
search_text = params['sSearch'] | |
sort_cols_count = params['iSortingCols'].to_i | |
columns = (0..cols_count-1).map { |i| params["mDataProp_#{i}"] } |
This file contains hidden or 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
.page { | |
width: 680px; | |
background-color: #f3f2ee; | |
color: #000000; | |
text-rendering: optimizelegibility; | |
font-family: Georgia !important; | |
} | |
.page > * { | |
zoom: 1; | |
} |
This file contains hidden or 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
Mac OS: | |
sudo bash -c 'echo RTMFPP2PDisable=1 >> /Library/Application\ Support/Macromedia/mms.cfg' | |
Windows: | |
echo RTMFPP2PDisable=1 >> %windir%\system32\Macromed\Flash\mms.cfg | |
echo RTMFPP2PDisable=1 >> %windir%\syswow64\Macromed\Flash\mms.cfg | |
echo RTMFPP2PDisable=1 >> %windir%\system32\mms.cfg | |
Linux: | |
sudo mkdir -p /etc/adobe |
This file contains hidden or 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
# My Alias | |
alias ams='cd ~/Workspace/pzgz/tongji_ams/ams' | |
alias workspace='cd ~/Workspace/' | |
alias ws='cd ~/Workspace/' | |
alias os='cd ~/Workspace/opensources' | |
alias adx='cd ~/Workspace/adsvana/adx' | |
alias bid='cd ~/Workspace/adsvana/adx_bidder' | |
alias is='cd ~/Workspace/pzgz/itravels/' | |
alias ib='cd ~/Workspace/pzgz/itravels/backbone/' | |
alias ims='cd ~/Workspace/pzgz/pister/ims/' |
This file contains hidden or 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/sh | |
#set -x | |
host='autoddvpn.googlecode.com' | |
cv_dir='/jffs/var/' | |
cv_file="${cv_dir}version.client" | |
vpnup_remote_path='http://autoddvpn.googlecode.com/svn/trunk/grace.d/vpnup.sh' | |
vpndown_remote_path='http://autoddvpn.googlecode.com/svn/trunk/grace.d/vpndown.sh' | |
vpnup_local_path='/jffs/openvpn/vpnup.sh' | |
vpndown_local_path='/jffs/openvpn/vpndown.sh' |
This file contains hidden or 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
~ brew --config | |
HOMEBREW_VERSION: 0.9.5 | |
ORIGIN: https://github.com/Homebrew/homebrew.git | |
HEAD: 25cffcf1e4fa8b2bc8f989d33d8946978a2da9d4 | |
HOMEBREW_PREFIX: /usr/local | |
HOMEBREW_CELLAR: /usr/local/Cellar | |
CPU: 8-core 64-bit ivybridge | |
OS X: 10.9.4-x86_64 | |
Xcode: 5.1.1 | |
CLT: 5.1.0.0.1.1396320587 |
OlderNewer