Skip to content

Instantly share code, notes, and snippets.

@kechol
kechol / gist:1056884
Created June 30, 2011 18:39
Debian on Sakura VPS Install log
#execute as root user
aptitude update
aptitude install sudo
apt-get install build-essential sysv-rc-conf vim
apt-get install libssh-dev curl git-core sendmail sendmail-bin nkf
apt-get install mysql-client mysql-server libmysqlclient-dev
apt-get install apache2 libapache2-mod-php5
apt-get install php5 php-pear php-apc php5-cli php5-curl php5-gd php5-mcrypt php5-mysql
apt-get install libreadline5-dev libapache2-mod-ruby libapr1-dev libaprutil1-dev zlib1g-dev
@kechol
kechol / gist:1057668
Created July 1, 2011 01:07
vimrc settings
set encoding=utf-8
set termencoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8,iso-2022-jp,euc-jp,ucs2le,ucs-2
set wrap
set wrapscan
set number
set ruler
set noexpandtab
set tabstop=4
@kechol
kechol / gist:1392975
Created November 25, 2011 07:06
Amazon Product Advertising API sample for PHP
<?php
require_once '../config.php';
function sign($url, $params) {
$parsed_url = parse_url($url);
$query = http_build_query_rfc3986($params);
$request = array(
'GET',
$parsed_url['host'],
@kechol
kechol / HogeMobile.class.php
Created December 18, 2011 09:46
2年前くらいに作った携帯用のサイトエンジン(for PHP4) HTML_Emojiを利用して3キャリアで絵文字が表示できたりした。
<?php
require_once 'Mobile.class.php';
class HogeMobile extends Mobile {
var $title = 'TItle';
var $key_color = '#000';
var $link_color = '#00f';
var $visited_color = '#00f';
var $active_color = '#f00';
@kechol
kechol / RayTracer.cpp
Created December 18, 2011 10:01
ICGで作成したRayTraceのコード
// The main ray tracer.
#pragma warning (disable: 4786)
#include "RayTracer.h"
#include "scene/light.h"
#include "scene/material.h"
#include "scene/ray.h"
#include "parser/Tokenizer.h"
@kechol
kechol / setup.sh
Created February 19, 2012 07:47
setup script for my dotfiles
#!/bin/bash
#packages
sudo apt-get -y update
sudo apt-get install -y zsh tmux vim git-core
#zsh
sudo chsh -s /bin/zsh
@kechol
kechol / Capfile
Created April 27, 2012 04:44
capistrano deploy config
load 'deploy'
# Uncomment if you are using Rails' asset pipeline
load 'deploy/assets'
Dir['vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) }
load 'config/deploy' # remove this line to skip loading any of the default tasks
@kechol
kechol / ror.markdown
Created May 19, 2012 07:06
RoR setup in AWS EC2(Ubuntu 12.04 LTS)

create user

sudo useradd -m username visudo

delete default user

sudo userdel ubuntu sudo rm -Rf ubuntu

@kechol
kechol / gitconfig
Created May 23, 2012 08:57
configuration for git
[user]
name = Your Name
email = [email protected]
[alias]
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
st = status
ci = commit
co = checkout
@kechol
kechol / seeds.rb
Created June 15, 2012 07:35
insert rails seeds from google spreadsheet
require 'rubygems'
require 'google_drive'
# set your username and password
login = GoogleDrive.login(GoogleDrive::USERNAME, GoogleDrive::PASSWORD)
# set your spreadsheet key
sheet = login.spreadsheet_by_key(GoogleDrive::SPREADSHEET)
sheet.worksheets.each do |ws|
p ws.title