Skip to content

Instantly share code, notes, and snippets.

View tkfm-yamaguchi's full-sized avatar

Takafumi Yamaguchi tkfm-yamaguchi

View GitHub Profile

GitHub Flow

31 Aug 2011

git-flowの問題点 (Issues with git-flow)

私は人々にGitを教えるためにあちこちを飛び回っているが、最近のほぼすべてのクラスやワークショップで git-flow についてどう思うかを尋ねられた。私はいつも、git-flowは素晴らしいと思うと答えている。何百万ものワークフローを持ったシステム(Git)を提供し、ドキュメントもあるし、よくテストされている。フレキシブルなワークフローは、実に容易なやり方で多くの開発者の役に立つ。標準的なものになりつつあり、開発者はプロジェクトや企業の間を移動しつつこの標準的なワークフローに馴染むことができる。

@tkfm-yamaguchi
tkfm-yamaguchi / .rspec.diff
Last active August 29, 2015 13:59
Init rails 4.1
# rspec3' generator ( 'rspec:install' ) creates .spec
# with '--warnings' as default.
# That causes printing the messages like below:
#
# vendor/bundle/ruby/2.1.0/gems/celluloid-0.15.2/lib/celluloid/tasks.rb:76: warning: global variable `$CELLULOID_DEBUG' not initialized
# vendor/bundle/ruby/2.1.0/gems/guard-2.6.1/lib/guard/interactor.rb:64: warning: instance variable @enabled not initialized
#
# This is very messy especially when using guard + spring because it puts the messages continuously.
# I hate that so that remove the option.
class Life
@hack: (session, after_all=->) ->
klass = new @()
session(klass)
klass.run(after_all)
constructor: ->
@strs = []
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
###
# 16.
# You have eight balls all of the same size. 7 of them weigh the same, and one of them weighs slightly more.
# How can you find the ball that is heavier by using a balance and only two weighings?
###
module Generator
def self.generate_heavier_index(max=8)
Time.now.sec.modulo(max)
end
@tkfm-yamaguchi
tkfm-yamaguchi / tidy.conf
Created June 19, 2014 00:53
predefined configuration file for tidy which preforms HTML, XML
// for xml
indent:yes
indent-spaces:4
fix-uri:no
input-xml:yes
literal-attributes:yes
output-xml:yes
quote-ampersand:no
wrap:0
char-encoding:UTF8
@tkfm-yamaguchi
tkfm-yamaguchi / gem-version-works
Created June 20, 2014 07:25
math like version number comparison in ruby
$ irb
irb(main):001:0> stable = Gem::Version.new("1.6.2")
=> #<Gem::Version "1.6.2">
irb(main):002:0> pre = Gem::Version.new("2.0.0.pre")
=> #<Gem::Version "2.0.0.pre">
irb(main):003:0> pub = Gem::Version.new("2.0.0")
=> #<Gem::Version "2.0.0">
irb(main):004:0> stable < pre
=> true
irb(main):005:0> pre < pub
$ ruby -v
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux]
$ ls
milkode-1.7.2.pre.gem
$ gem uninstall thin
Remove executables:
thin
in addition to the gem? [Yn] y
Removing thin
@tkfm-yamaguchi
tkfm-yamaguchi / application.js.coffee
Last active August 29, 2015 14:02
Can't use method chain among argument
#= require jquery
$ ->
$ "body"
.append
$ "<div>"
.text "Greeting"
.click -> alert("Hi!")
###
#!/usr/bin/env ruby
# coding: utf-8
require "fileutils"
require "pathname"
include FileUtils
class Pathname
def replace_extname(new_ext)