Skip to content

Instantly share code, notes, and snippets.

View xiaods's full-sized avatar
🌏
Coding for Fun

Deshi Xiao xiaods

🌏
Coding for Fun
View GitHub Profile
#!/usr/bin/env ruby
# Usage:
# ruby plugin_to_gem.rb my_plugin_directory
require 'fileutils'
@plugin_dir = ARGV[0]
@plugin_name = ARGV[0]
def rakefile_content
description = 'TODO'
#!/usr/bin/env ruby
# Written by Kieran P
# http://github.com/KieranP
# http://twitter.com/k776
# http://k776.tumblr.com
#
# Feel free to fork and modify.
# If you do, send me a message on
# Github details changes and I'll
@xiaods
xiaods / hubbub.py
Created February 25, 2010 10:56 — forked from Arachnid/hubbub.py
from google.appengine.api import urlfetch
from google.appengine.api import xmpp
from google.appengine.ext import db
from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app
from google.appengine.ext.webapp import xmpp_handlers
import base64
import feedparser
import logging
############## commands #################
run "touch tmp/.gitignore log/.gitignore vendor/.gitignore"
run %{find . -type d -empty | grep -v "vendor" | grep -v ".git" | grep -v "tmp" | xargs -I xxx touch xxx/.gitignore}
run "rm .gitignore"
file '.gitignore', <<-ENDEND
.DS_Store
log/*.log
tmp/**/*
config/database.yml
@xiaods
xiaods / gist:337218
Created March 19, 2010 04:06 — forked from gerhard/etc_default_php-fastcgi
REE + nginx + Passenger + MySQL + mysql gem + git on Ubuntu 9.10 Karmic
# inspiration
# http://github.com/jnstq/rails-nginx-passenger-ubuntu
# sudo this sudo that bollocks
sudo -i
# system-related stuff
apt-get install htop strace sysstat
dpkg-reconfigure sysstat
apt-get install ntp
@xiaods
xiaods / gist:420453
Created June 1, 2010 01:31 — forked from wayneeseguin/gist:296055
rvm and rails3 setup follow
This example shows how to setup an environment running Rails 3 beta 3 under 1.9.2-head with a 'rails3' gem set.
∴ rvm update --head
# ((Open a new shell)) or do 'rvm reload'
# If you do not already have the ruby interpreter installed, install it:
∴ rvm install 1.9.2-head
# Switch to 1.9.2-head and gemset rails3, create if it doesn't exist.
∴ rvm --create use 1.9.2-head@rails3
user app;
worker_processes 2;
error_log /home/app/logs/nginx.error.log info;
events {
worker_connections 1024;
}
@xiaods
xiaods / gist:924997
Created April 18, 2011 08:34 — forked from thokra/gist:660949
batik highcharts imager convertor
class SvgController < ApplicationController
require 'active_support/secure_random'
def create
# create an SVG image
# based on Highcharts index.php
batik_path = Rails.root.to_s() + '/vendor/batik/batik-rasterizer.jar'
svg = params[:svg]
filename = params[:filename].blank? ? "chart" : params[:filename]
@xiaods
xiaods / gist:952663
Created May 3, 2011 01:19 — forked from anonymous/gist:887026
reverse proxy for tumblr,reference
upstream tumblr {
server 72.32.231.8:80;
}
server {
listen 80;
server_name jyorr.com;
access_log /var/log/nginx/jyorr.access.log;