Skip to content

Instantly share code, notes, and snippets.

@insoul
insoul / gist:2090367
Created March 19, 2012 02:02 — forked from codian/key-bindings.json
sublime text 2 설정
// file settings
{
"gutter": false,
"line_numbers": false,
"color_scheme": "Packages/Color Scheme - Default/LAZY.tmTheme",
"line_padding_bottom": 0,
"line_padding_top": 2,
"font_face": "Andale Mono",
"font_size": 16.0,
@insoul
insoul / nginx
Created March 26, 2012 09:10
Nginx init script
#!/bin/sh
# File: /etc/init.d/nginx
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
@insoul
insoul / install_nginx.sh
Created March 26, 2012 09:29
install nginx
#!/bin/sh
set -x
nginx_version=1.0.9
sudo apt-get install gcc
sudo apt-get install libpcre3-dev
sudo apt-get install libssl-dev
mkdir install_nginx && cd install_nginx
@insoul
insoul / commit-msg
Created April 10, 2012 07:14
git commit hook for redmine
#!/usr/bin/env ruby
BASEDIR = ENV["HOME"] + "/.git_redmine"
require BASEDIR + "/git_redmine"
include GitRedmine::Hooks
exit commit_msg(ARGV[0])
@insoul
insoul / .gitconfig
Created September 26, 2012 03:04
git global config
[user]
name = Foo
email = foo@gmail.com
[color]
diff = auto
status = auto
branch = auto
interactive = auto
[merge]
summary = true
@insoul
insoul / Preferences.sublime-settings.json
Last active December 10, 2015 17:28
Preference for Sublime Text 2. Install Package Control and add next packages. Soda theme and color scheme, SublimeLinter, Git
{
// global settings
"theme": "Soda Light 3.sublime-theme",
"folder_exclude_patterns":
[
".idea",
".bundle",
".git",
"log"
],
@insoul
insoul / db_migrate_force.rake
Created March 24, 2013 13:38
rails schema_migrations table manipulation
namespace :db do
namespace :migrate do
desc 'insert version to migration table directly'
task :force, :version do |t, args|
ActiveRecord::Base.connection.initialize_schema_migrations_table
version = Integer(ENV['VERSION'] || args[:version])
migrations = ActiveRecord::Migrator.migrations(ActiveRecord::Migrator.migrations_paths)
table = Arel::Table.new(ActiveRecord::Migrator.schema_migrations_table_name)
migrated = ActiveRecord::Migrator.get_all_versions
@insoul
insoul / gitipe.rb
Last active December 15, 2015 13:39
capistrano recipe for using git file as capistrano recipe
# use recipe on git.
#
# necessary variable: none
#
# optional variable:
# gitipe_repository:
# if this is empty, use source as gitipe
# gitipe_branch:
# if gitipe_repository is not empty, this varaible is not used
# default "master"
@insoul
insoul / gist:6917894
Created October 10, 2013 12:57
yield vs block.call vs instance_eval(&block)
class A
def yield_block
yield
end
def call_block(&block)
block.call
end
def eval_block(&block)
@insoul
insoul / subp
Last active December 28, 2015 07:39
Make Sublime Text project file using ruby bundler. Project file will be created in upper folder. Check `subp --help`
#!/usr/bin/env ruby
require 'json'
require 'optparse'
# variables
project_name = Dir.pwd.split('/').last
project_file = "../.#{project_name}.sublime-project"
puts "Project file is #{project_file}"
# gem attributes