This file contains 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
defaults: &defaults | |
adapter: mysql2 | |
host: localhost | |
username: root | |
password: | |
development: | |
<<: *defaults | |
database: db_name_dev |
This file contains 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
sudo apt-get install python-software-properties python g++ make | |
sudo add-apt-repository ppa:chris-lea/node.js | |
sudo apt-get update | |
sudo apt-get install nodejs npm | |
gem install execjs |
This file contains 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
deb http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ lucid-proposed main restricted universe multiverse | |
deb http://mirrors.163.com/ubuntu/ lucid-backports main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ lucid main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ lucid-security main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ lucid-updates main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ lucid-proposed main restricted universe multiverse | |
deb-src http://mirrors.163.com/ubuntu/ lucid-backports main restricted universe multiverse |
This file contains 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
#!/usr/bin/ruby | |
require 'rss' | |
p 'Downloading rss index' | |
rss_string = open('http://railscasts.com/subscriptions/xx/episodes.rss').read | |
rss = RSS::Parser.parse(rss_string, false) | |
videos_urls = rss.items.map { |it| it.enclosure.url }.reverse | |
videos_filenames = videos_urls.map {|url| url.split('/').last } |
This file contains 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
/** | |
* | |
* Base64 encode / decode | |
* http://www.webtoolkit.info/ | |
* | |
**/ | |
var Base64 = { | |
// private property |
This file contains 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 xxx() { | |
alert($); | |
}; | |
var headID = document.getElementsByTagName("head")[0]; | |
var newScript = document.createElement('script'); | |
newScript.type = 'text/javascript'; | |
newScript.src = 'http://cdn.agideo.com/jquery/1.8.2/jquery.min.js'; | |
newScript.onload = xxx; | |
headID.appendChild(newScript); |
This file contains 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
#INSTALL | |
#curl -sL https://raw.github.com/gist/3938830/backup.rake --output ./lib/tasks/backup.rake | |
require 'fileutils' | |
require 'enumerator' | |
require 'date' | |
namespace :backup do | |
def run_cmd(cmd) |
This file contains 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
/* focus */ | |
#focus{width:800px;height:280px;overflow:hidden;position:relative;} | |
#focus ul{height:380px;position:absolute;} | |
#focus ul li{float:left;width:800px;height:280px;overflow:hidden;position:relative;background:#000;} | |
#focus ul li div{position:absolute;overflow:hidden;} | |
#focus .btnBg{position:absolute;width:800px;height:20px;left:0;bottom:0;background:#000;} | |
#focus .btn{position:absolute;width:780px;height:10px;padding:5px 10px;right:0;bottom:0;text-align:right;} | |
#focus .btn span{display:inline-block;_display:inline;_zoom:1;width:25px;height:10px;_font-size:0;margin-left:5px;cursor:pointer;background:#fff;} | |
#focus .btn span.on{background:#fff;} | |
#focus .preNext{width:45px;height:100px;position:absolute;top:90px;background:url(img/sprite.png) no-repeat 0 0;cursor:pointer;} |
This file contains 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
<!DOCTYPE html> | |
<html lang="zh-CN"> | |
<head> | |
<meta charset="utf-8"> | |
<title>ServerJS</title> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
</head> | |
<body> | |
<div class="container"> | |
<button id="hello">Test</button> |
This file contains 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
#!/usr/bin/env bash | |
export MY_RUBY_HOME=/opt/ruby-enterprise-1.8.7-2012.02 | |
export PATH=$MY_RUBY_HOME/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games | |
export GEM_HOME=$MY_RUBY_HOME/lib/ruby/gems/1.8/gems/ | |
cd /var/www/smsserver && bundle exec rake xxxx RAILS_ENV=production |