Skip to content

Instantly share code, notes, and snippets.

View umhan35's full-sized avatar

Zhao Han umhan35

View GitHub Profile
# unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D
rails_env = ENV['RAILS_ENV'] || 'production'
# 16 workers and 1 master
worker_processes (rails_env == 'production' ? 16 : 4)
# Load rails+github.git into the master before forking workers
# for super-fast worker spawn times
preload_app true
@shawn0lds442
shawn0lds442 / WebScraper.rb
Created December 21, 2011 00:48
Web Scraper for Data Mining
require 'mechanize'
require 'active_record'
require 'nokogiri'
require 'sqlite3'
require 'csv'
ActiveRecord::Base.establish_connection(:adapter => "sqlite3", :database => "db")
ActiveRecord::Schema.define do
create_table "locations", :force => true do |t|
@marioBonales
marioBonales / .bashrc
Created January 19, 2012 03:56
Default .bashrc for ubuntu
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@adtaylor
adtaylor / CoffeeScript_jQuery_Plugin_Pattern.coffee
Created April 23, 2012 11:08
This is a CoffeeScript implementation of Twitter Bootstrap's approach to jQuery plugin development
# ============================================================
# PluginName v0.0.0
# http://URL
# ============================================================
# Copyright 2012 The Beans Group
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@drogus
drogus / Gemfile
Created April 24, 2012 18:43
AbstractController
gem "actionpack"
@rjz
rjz / cs-jq-plugin-template.coffee
Created September 3, 2012 17:01
Coffeescript jQuery Plugin Class Template
# A class-based template for jQuery plugins in Coffeescript
#
# $('.target').myPlugin({ paramA: 'not-foo' });
# $('.target').myPlugin('myMethod', 'Hello, world');
#
# Check out Alan Hogan's original jQuery plugin template:
# https://github.com/alanhogan/Coffeescript-jQuery-Plugin-Template
#
(($, window) ->
@eLindemann
eLindemann / dabblet.css
Created April 1, 2013 20:41
"Google Now" Card
/**
* "Google Now" Card
*/
body {
background: #e1e1e1;
min-height: 100%;
margin: auto;
}
ul.gNow {
width: 450px;
@rogerleite
rogerleite / _install.md
Last active May 19, 2023 16:57
Some scripts to install things

Introduction

Some install scripts. Target to work with Ubuntu 12 or greater.

Table of Scripts

@fenixbrassi
fenixbrassi / gist:7954023
Created December 14, 2013 00:27
TryRuby Challenge
Interactive ruby ready.
> help
> 2 + 6
=> 8
Success!
> 4 * 10
=> 40
> 5 - 12
=> -7
> 40 / 4
@basti
basti / application.rb
Last active March 1, 2021 10:42 — forked from keighl/application.rb
Local Rails 4 assets precompilation using Capistrano 3 and rsync
# Speed things up by not loading Rails env
config.assets.initialize_on_precompile = false