This file contains 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
class Hoe | |
# attr_accessor | |
def initialize(attributes = nil) | |
assign_attributes(attributes) if attributes | |
yield self if block_given? | |
end | |
def assign_attributes(new_attributes) | |
new_attributes.each do |k, v| |
This file contains 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 | |
require 'webrick' | |
srv = WEBrick::HTTPServer.new( | |
:BindAddress => '127.0.0.1', # '0.0.0.0' allow remote access | |
:Port => (port = ARGV[0].to_i) === 0 ? 3000 : port, | |
:DocumentRoot => './', | |
:DoNotReverseLookup => true | |
) | |
trap(:INT){srv.shutdown} | |
srv.start |
This file contains 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
$('body').on('click', 'a', function(e) { | |
e.preventDefault(); | |
$.get($(this).attr('href')).success(function(html) { | |
$('body').html(''); | |
$('body').append($(html).find('body')); | |
}) | |
}); |
This file contains 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 | |
# | |
#= Export diff files between 2 revisions. | |
# | |
# export only commited files for SourceTree. | |
# | |
#== setup | |
# | |
# set this script to cunstom action. | |
# then, set "$REPO $SHA" in parameters. |
This file contains 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 | |
# | |
#= Export diff files between revs. | |
# | |
# export only commited files. | |
# | |
#== setup | |
# | |
# set this script to cunstom action. | |
# then, set "$SHA" in parameters. |
This file contains 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
/* 先頭行: 他のスクリプトでのセミコロン忘れに備え、且つ、予約語でないundefinedの書換えによる誤動作を防いでいる。*/ | |
;(function($, undefined) { | |
"use strict"; | |
$.fn.myPlugIn = function(option) { | |
var a, b, c; | |
//※未設定のオプション項目に初期値を設定 | |
option = $.extend({ | |
opt1: null, |
This file contains 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
(A[CDEFGILMNOQRSTUWZ]|B[ABDEFGHIJMNORSTVWYZ]|C[ACDFGHIKLMNORUVXYZ]|D[JKMOZCEGRST]|F[IJKMOR]|G[ABDEFGHILMNPQRSTUWY]|H[KMNRTU]|I[DELMNOQRST]|J[EMOP]|K[EGHIMNPRWYZ]|L[ABCIKRSTUVY]|M[ACDGHKLMNOPQRSTUVWXYZ]|N[ACEFGILOPRUZ]|OM|P[AEFGHKLMNRTWY]|QA|R[EOUW]|S[ABCDEGHIJKLMNORTUVYZ]|T[CDFGHJKMNOPRTVWZ]|U[AGKMSYZ]|V[ACEINU]|W[FS]|Y[ETU]|Z[AMRZW]) |
This file contains 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
# grunt install grunt-contrib --save-dev | |
# grunt install grunt-bower-task --save-dev | |
'use strict' | |
excludes = [ | |
'!**/.DS_Store' | |
'!**/Thumbs.db' | |
'!**/*.coffee' | |
'!**/*.map' |
This file contains 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
<?php | |
function timeAgoInWords($datetime, $now = null){ | |
if($now === null){ $now = date('Y-m-d H:i:s'); } | |
$units = array( | |
'y' => 31104000, | |
'm' => 2592000, | |
'd' => 86400, | |
'h' => 3600, |
OlderNewer