Skip to content

Instantly share code, notes, and snippets.

View song940's full-sized avatar
👨‍💻
Typing ...

Lsong song940

👨‍💻
Typing ...
View GitHub Profile
@song940
song940 / loudatui.rb
Last active March 23, 2016 09:05
Image downloader for loudatui.com
require 'net/http'
require 'nokogiri'
###
# Lsong
# i@lsong.org
# http://lsong.org
#
# MIT LICENSE
# http://lsong.mit-license.org/
#
@song940
song940 / youjizz.rb
Last active December 24, 2015 05:29
Youjizz Downloader
# encoding: UTF-8
require 'net/http'
require 'nokogiri'
require 'colorize'
require 'fileutils'
require 'tempfile'
require 'uri'
require 'json'
@song940
song940 / vpncloud.rb
Last active December 24, 2015 05:39
云梯测速
require 'net/ping'
require 'nokogiri'
require 'colorize'
###
# Lsong
# i@lsong.org
# http://lsong.org
#
# MIT LICENSE
# http://lsong.mit-license.org/
@song940
song940 / url2go.rb
Created October 11, 2013 09:42
网址压缩
require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'dm-timestamps'
require 'dm-migrations'
require 'dm-serializer'
require 'json'
require 'net/http'
@song940
song940 / lsusb.sh
Created October 25, 2013 04:53
lsusb for mac os
#!/usr/bin/env bash
# lsusb (list USB devices) utility for Mac OS X
# Author: JLH, Sep 2013
# Usage:
#
# lsusb [ options ]
#
# Options:
# -v
# Print the original output of `system_profiler SPUSBDataType`
@song940
song940 / si.rb
Created October 30, 2013 10:14 — forked from rasefon/si.rb
require 'RMagick'
$scale_size = 256.0
$img_fn1 = ARGV[0]
$img_fn2 = ARGV[1]
$scale_size = ARGV[2].to_f if ARGV[2]
def calculate_threshold(img_fn)
dir_name = File.dirname(img_fn)
@song940
song940 / blah.sh
Created November 11, 2013 03:53
Making scripts run at boot time with Debian
#! /bin/sh
# /etc/init.d/blah
#
# Some things that run always
touch /var/lock/blah
# Carry out specific functions when asked to by the system
case "$1" in
start)
@song940
song940 / mina.rb
Last active December 28, 2015 01:59
mina + unicorn + nginx
require 'mina/bundler'
require 'mina/rails'
require 'mina/git'
# require 'mina/rbenv' # for rbenv support. (http://rbenv.org)
require 'mina/rvm' # for rvm support. (http://rvm.io)
# Basic settings:
# domain - The hostname to SSH to.
# deploy_to - Path to deploy into.
# repository - Git repo to clone from. (needed by mina/git)
# branch - Branch name to deploy. (needed by mina/git)
@song940
song940 / i.rb
Created November 20, 2013 08:42
simple irb
# simple irb
prompt = '[0] '
binding = Object.new.send :binding
loop do
print prompt
prompt.succ!
begin
res = binding.eval gets
" git clone http://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
" BundleInstall
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle