Skip to content

Instantly share code, notes, and snippets.

@Sen
Sen / runner.js
Created March 21, 2013 08:09
angular.js seo
phantom = require("phantom")
express = require("express")
app = express()
app.get "*", (req, res) ->
phantom.create (ph) ->
ph.createPage (page) ->
page.open "http://localhost:9000/#{req.route.params[0]}", (status) ->
page.evaluate (-> document.getElementsByTagName('html')[0].outerHTML), (result) ->
res.end result
@Sen
Sen / nginx.conf
Created November 6, 2012 09:24
rails sendfile with nginx
location ~ /data {
internal;
root /rails/app/path;
}
location / {
#......
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
@Sen
Sen / deploy.rb
Created June 7, 2012 14:59
my wizzey cap
require 'bundler/capistrano'
set :application, "wizzey"
default_run_options[:pty] = true # Must be set for the password prompt from git to work
set :repository, "[email protected]:mehdi/Wizzey.git" # Your clone URL
set :branch, "master"
set :scm, "git"
set :user, "app" # The server's user for deploys
set :deploy_to, "/opt/webapps/#{application}"
set :deploy_via, :remote_cache
@Sen
Sen / dd_qos
Created April 4, 2012 19:03
dd-wrt qos script
iptables -t mangle -F
iptables -t mangle -X
#download
tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb default 20
# download
# level 1