Skip to content

Instantly share code, notes, and snippets.

View gouf's full-sized avatar
😇
I don't know how my life work with.

Go Furuya gouf

😇
I don't know how my life work with.
View GitHub Profile
@rdegges
rdegges / proxy_nginx.sh
Created April 11, 2011 05:30
Create a HTTP proxy for jenkins using NGINX.
sudo aptitude -y install nginx
cd /etc/nginx/sites-available
sudo rm default
sudo cat > jenkins
upstream app_server {
server 127.0.0.1:8080 fail_timeout=0;
}
server {
listen 80;
@nukemberg
nukemberg / knife.sh
Created June 28, 2011 07:51 — forked from ches/knife
bash completion for Chef's knife command (updated for 0.10)
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab:
# Author: Avishai Ish-Shalom <avishai@fewbytes.com>
# We need to specify GNU sed for OS X, BSDs, etc.
if [[ "$(uname -s)" == "Darwin" ]]; then
SED=gsed
else
SED=sed
fi
@miya0001
miya0001 / example.com.conf
Created October 14, 2011 08:44
nginx+リバースプロキシでバーチャルホスト
#
# A virtual host using WordPress
# /etc/nginx/conf.d/example.com.conf
#
server
{
listen 8080;
client_max_body_size 10m;
server_name .example.com;
@FGRibreau
FGRibreau / times.js
Created February 5, 2012 22:45
Ruby .times & .upto & .downto methods in JavaScript
// Ruby = 5.times { |i| puts i }
// JS = (1).times(function(i){console.log(i);})
Number.prototype.times = function(cb) {
var i = -1;
while (++i < this) {
cb(i);
}
return +this;
@mungruby
mungruby / singleton_struct.rb
Created May 29, 2012 02:10
Avoiding redefining constant Struct::ClassName warnings
fields = [:switch, :sha_ind, :dtdm, :utdm, :ttdm, :actual]
def create_struct name, fields
Struct.new(name, *fields)
end
def create_singleton_struct name, fields
if Struct::const_defined? name
Struct.const_get name
else
@mornone
mornone / Excel.php
Created July 4, 2012 03:37 — forked from ihumanable/Excel.php
Simple Excel Writer in PHP
<?php
/**
* Simple excel writer class with no external dependencies, drop it in and have fun
* @author Matt Nowack
* @license Unlicensed
* @version 1.0
*/
class Excel {
private $col;
@linjunpop
linjunpop / README.md
Created August 21, 2012 01:15
Rails flash messages with AJAX requests
#!/bin/bash
COMPASS="/var/lib/gems/1.8/bin/compass"
case "$1" in
""|start)
echo "Starting compass watch..."
if [ -f ./cwatch.pid ]
then
echo "Sorry, but compass is already watching this folder..."
@jugyo
jugyo / gist:4071551
Created November 14, 2012 11:07
how to import ekidata for rails

駅データ.jp から以下のようなファイルをダウンロードし、 db/seeds/ekidata とか適当な場所に置く:

  • station20121102free.csv
  • line20121030free.csv
  • company20121010.csv

マイグレーション:

# db/migrate/XXXXXXXXXXXXXX_create_ekidata_stations.rb
@yatt
yatt / createDatabaseAs.sh
Created November 14, 2012 14:30
駅データ.jpのデータをsqlite3に取り込むシェルスクリプト
#! /bin/sh
#
# データベース作成スクリプト.
# 引数に渡されたパスにデータベースを構成・データを投入する
#
#
# sample:
# sh createDatabaseAs.sh db.sqlite3
#