This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
browser_title="Google Chrome" | |
terminal_title="byobu" | |
current_window_id=$(xdotool getwindowfocus) | |
browser_window_id=$(xdotool search --name --onlyvisible "$browser_title") | |
terminal_window_id=$(xdotool search --name --onlyvisible "$terminal_title") | |
if test $current_window_id -eq $browser_window_id |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$primary-color-dark: #303F9F !default; //color depth 700 | |
$primary-color: #3F51B5 !default; //color depth 500 | |
$primary-color-light: #C5CAE9 !default; //color depth 100 | |
$accent-color: #F44336 !default; //color depth 500 | |
$primary-grey-text: #757575 !default; | |
$secondary-grey-text: #333 !default; | |
$divider-color: #B6B6B6 !default; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ./lib/tasks/db.rake | |
require 'active_record' | |
@logger = Logger.new(STDOUT) | |
namespace :db do | |
desc "Dumps the database to tmp/dbname.dump" | |
task mysql_dump: [:environment, :load_config] do | |
environment = Rails.env | |
configuration = ActiveRecord::Base.configurations[environment] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image_optim ./* \ | |
--allow-lossy --recursive --no-progress \ | |
--jpegrecompress-quality 0 --jpegoptim-max-quality 60 \ | |
--no-pngout --no-pngcrush --no-optipng --no-advpng \ | |
--pngquant-quality 20-40 \ | |
--gifsicle-level 3 --gifsicle-careful true --no-svgo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BASE = "image_optim" | |
BASE_OPT = "--allow-lossy --recursive --no-progress" | |
JPEG_OPT = "--jpegrecompress-quality 0 --jpegoptim-max-quality 60" | |
PNG_OPT = "--no-pngout --no-pngcrush --no-optipng --no-advpng --pngquant-quality 20-40" | |
OTHER_OPT = "--gifsicle-level 3 --gifsicle-careful true --no-svgo" | |
image_optim ./* --allow-lossy --recursive --no-progress --jpegrecompress-quality 0 --jpegoptim-max-quality 60 --no-pngout --no-pngcrush --no-optipng --no-advpng --pngquant-quality 20-40 --gifsicle-level 3 --gifsicle-careful true --no-svgo |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Settings | |
set hud | |
set smoothscroll | |
"set noautofocus "The opposite of autofocus; this setting stops sites from focusing on an input box when they load | |
set typelinkhints | |
"chrome://extensions --> shortcut --> set ctrl+n as cvim's shortcut | |
set cncpcompletion | |
let searchlimit = 30 | |
let scrollstep = 150 | |
let barposition = "top" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
message_file = ARGV[0] | |
message = File.read(message_file, :encoding => Encoding::UTF_8) | |
# remove prefix issue number like [#1234] from COMMIT_EDITMSG | |
message = message.sub(/^\[#[0-9A-Za-z_].*\]/, "") | |
# remove comment | |
message = message.gsub(/^#(?! ------------------------ >8 ------------------------).*\n|^\n/, "") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# set to repository/.git/hooks/prepare-commit-msg | |
# chmod +x prepare-commit-msg | |
COMMIT_EDITMSG=$1 | |
mv $COMMIT_EDITMSG $COMMIT_EDITMSG.tmp | |
number=`git branch | grep "*" | awk '{print $2}' | sed -e "s/^\([0-9]*\).*/\1/g"` | |
msg="" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#NOTE: create id_hash for paperclip's url | |
# e.g) photo_id = 14721; format("%09d", photo_id).split("").each_slice(3).map{ |array| array.join("") }.join("/") | |
# # => "000/014/721" | |
id_hash = format("%09d", photo_id).split("").each_slice(3).map{ |array| array.join("") }.join("/") |