Skip to content

Instantly share code, notes, and snippets.

@losingle
losingle / flex_sdk.rb
Created January 31, 2013 13:50 — forked from jtvjt/flex_sdk.rb
require 'formula'
class FlexSdk < Formula
url 'http://fpdownload.adobe.com/pub/flex/sdk/builds/flex4.5/flex_sdk_4.5.1.21328.zip'
md5 '55a59986092195a88cfe7b5796ec8619'
homepage 'http://opensource.adobe.com/'
version 'v4.5.1.21328'
def install
Dir['*'].each { |file| cp_r file, File.join( prefix, File.basename(file) ) }
#NOTE: .pydistutils.cfg seems to be not compatible with brew install python
#areas I needed to clean before installation
#clean up ~/Library/Python
#clean up .local
brew install python --framework
easy_install pip
pip install virtualenv
pip install virtualenvwrapper
mkdir $HOME/.virtualenvs
/*!
* jQuery TextChange Plugin
* http://www.zurb.com/playground/jquery-text-change-custom-event
*
* Copyright 2010, ZURB
* Released under the MIT License
*/
(function ($) {
$.event.special.textchange = {
@losingle
losingle / debugger.markdown
Created September 21, 2012 19:06 — forked from jcasimir/debugger.markdown
Ruby Debugger

Ruby Debugger

Most of the time simple output statements using warn, raise, or a logger will help you find your issue. But sometimes you need the big guns, and that means ruby-debug.

Ruby-Debug

The ruby-debug package has had some rocky times during the transition from Ruby 1.8.7 to 1.9.2 and beyond. But now, finally, the debugger is reliable and usable.

Installation

@losingle
losingle / README.markdown
Created September 21, 2012 16:29 — forked from greypants/README.markdown
RAILS 3: nav_link helper for adding 'selected' class to navigation elements

#Behold, the nav_link:

The nav_link helper works just like the standard Rails link_to helper, but adds a 'selected' class to your link (or its wrapper) if certain criteria are met. By default, if the link's destination url is the same url as the url of the current page, a default class of 'selected' is added to the link.

For full usage details, see: http://viget.com/extend/rails-selected-nav-link-helper

Drop nav_link_helper.rb into app/helpers in your Rails 3.x app and enjoy.

@losingle
losingle / squirrel.custom.yaml
Created September 19, 2012 09:50 — forked from lotem/squirrel.custom.yaml
【鼠鬚管】定製檔
# 適用於【鼠鬚管】0.9.6+
# 位置:~/Library/Rime/squirrel.custom.yaml
# 用法:想要哪項生效,就刪去該行行首的#字符,但注意保留用於縮進的空格
patch:
# us_keyboard_layout: true # 鍵盤選項:應用美式鍵盤佈局
# style/horizontal: true # 候選窗横向顯示
# style/font_face: "儷黑 Pro" # 我喜歡的字體名稱
# style/font_point: 21 # 字號
# style/corner_radius: 10 # 窗口圓角半徑
@losingle
losingle / data.json
Created September 11, 2012 09:57
javascript mentions(模拟新浪微博@功能)
[{"uname":"中文"},{"uname":"hello"}]
@losingle
losingle / zsh.md
Created August 21, 2012 03:14 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu

Install zsh

apt-get install zsh

Getting zsh to work in ubuntu is weird, since sh does not understand the source command. So, you do this to install zsh

wget https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh -O - | zsh

and then you change your shell to zsh

@losingle
losingle / upyun.rb
Created August 11, 2012 13:50 — forked from huobazi/upyun.rb
upyun-ruby-api
# -*- coding: utf-8 -*-
#
# :author yugi
# :email [email protected]
# :update 2012/5/18 14:56
module UpyunHttpMixin
def md5(s)
require 'digest/md5'
@losingle
losingle / wawammseg.py
Created June 30, 2012 09:45 — forked from onlytiancai/wawammseg.py
写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码
# -*- coding:utf-8 -*-
'写了一个简单的支持中文的正向最大匹配的机械分词,其它不用解释了,就几十行代码'
'搜狗词库下载地址:http://vdisk.weibo.com/s/7RlE5'
import string
__dict = {}
def load_dict(dict_file='words.dic'):
'加载词库,把词库加载成一个key为首字符,value为相关词的列表的字典'