Skip to content

Instantly share code, notes, and snippets.

View susieyy's full-sized avatar

yohei sugigami susieyy

View GitHub Profile
@susieyy
susieyy / 0_reuse_code.js
Created July 31, 2016 04:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@susieyy
susieyy / swift
Created June 17, 2016 10:03
Avoid awkward image animation with re-calculated height
UIView.setAnimationsEnabled(false)
self?.beginUpdates()
self?.endUpdates()
UIView.setAnimationsEnabled(true)
@susieyy
susieyy / peco_select_repository.fish
Created June 10, 2015 11:20
dotfiles/home/.config/fish/functions/peco_select_repository.fish
function peco_select_repository
if test (count $argv) = 0
set peco_flags --layout=bottom-up
else
set peco_flags --layout=bottom-up --query "$argv"
end
ghq list -p | peco $peco_flags | perl -pe 's/([ ()])/\\\\$1/g'| read foo
if [ $foo ]
@susieyy
susieyy / peco_change_directory.fish
Created June 10, 2015 11:19
dotfiles/home/.config/fish/functions/peco_change_directory.fish
function _peco_change_directory
if [ (count $argv) ]
peco --layout=bottom-up --query "$argv "|perl -pe 's/([ ()])/\\\\$1/g'|read foo
else
peco --layout=bottom-up |perl -pe 's/([ ()])/\\\\$1/g'|read foo
end
if [ $foo ]
builtin cd $foo
else
commandline ''
@susieyy
susieyy / fish_prompt.fish
Created June 10, 2015 11:18
dotfiles/home/.config/fish/functions/fish_prompt.fish
function fish_prompt
if not set -q -g __fish_robbyrussell_functions_defined
set -g __fish_robbyrussell_functions_defined
function _git_branch_name
echo (git symbolic-ref HEAD ^/dev/null | sed -e 's|^refs/heads/||')
end
function _is_git_dirty
echo (git status -s --ignore-submodules=dirty ^/dev/null)
@susieyy
susieyy / config.fish
Last active August 29, 2015 14:22
dotfiles/home/.config/fish/config.fish
# Path to your oh-my-fish.
set fish_path $HOME/.oh-my-fish
# Theme
set fish_theme agnoster # cean # zish # bobthefish # cmorrell.com # robbyrussell
# All built-in plugins can be found at ~/.oh-my-fish/plugins/
# Custom plugins may be added to ~/.oh-my-fish/custom/plugins/
# Enable plugins by adding their name separated by a space to the line below.
set fish_plugins theme git rbenv rails brew bundler gem osx pbcopy better-alias gi peco z tmux
# http://www.brynary.com/2008/8/3/our-git-deployment-workflow
class GitCommands
def diff_staging
`git fetch`
puts `git diff origin/production origin/staging`
end
def tag_staging(branch_name)
#####################################################################
# samples/a.rb
#####################################################################
require 'main'
ARGV.replace %w( 42 ) if ARGV.empty?
Main {
argument('foo'){
Here is what I propose for hooks in views:
view_[path_to_the_view]_[position_in_view]
Examples:
view_layouts_base_html_head -- the only one that was committed
view_issues_show_details_bottom
view_issues_list_table_header
view_issues_list_table_row
# redmine-budget-plugin / init.rb
require 'redmine'
# Budget requires the Rate plugin
begin
require 'rate' unless Object.const_defined?('Rate')
rescue LoadError
# rate_plugin is not installed
raise Exception.new("ERROR: The Rate plugin is not installed. Please install the Rate plugin from https://projects.littlestreamsoftware.com/projects/redmine-rate")