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 | |
# forked from https://github.com/benhoskings/dot-files/blob/master/files/bin/gbrt | |
def format_commit_info timestamp, time_desc, commit_id, message, ref_name | |
[ | |
"#{timestamp.strftime("%y %b %d")}, #{timestamp.strftime("%l:%M%p").downcase}", | |
"(#{time_desc})", | |
commit_id, | |
message, | |
ref_name |
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
# encoding: utf-8 | |
# $ ruby check_bot.rb | |
require 'open-uri' | |
@url = 'https://registrano.com/events/handlino-new-opening/registrations/new' | |
def check? | |
open(@url) do |f| | |
f.each_line do |line| | |
if line.include? '抱歉,目前本活動已額滿。' |
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
# ~/.irbrc | |
# Requires the following gems: wirble, hirb | |
# | |
# Hirb: http://tagaholic.me/hirb/doc/index.html | |
# Wirble: http://pablotron.org/software/wirble/ | |
require 'irb/completion' | |
require 'irb/ext/save-history' | |
IRB.conf[:SAVE_HISTORY] = 100 |
- foo
- bar
- temp
- [v] check
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
交通 transportation | |
工作 work | |
輔具 assistivedevice | |
購屋租屋 living | |
醫療照護 medical | |
急難救助 emergency | |
生活津貼 allowance | |
稅捐減免 tax | |
社會保險補助 socialinsurance | |
個案諮詢 consoult |
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
var q = {'category': ['living']}; | |
q = JSON.stringify(q); | |
$.ajax({ | |
type: "GET", | |
url: '/api/search', | |
data: {q: q}, | |
dataType: 'json' | |
}).success(function(data){ | |
console.log(data); | |
}) |
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
# fix code from https://github.com/bcardarella/client_side_validations/issues/499 | |
unless "indexOf" of Array:: | |
Array::indexOf = (find, i) -> | |
i = 0 if i is `undefined` | |
i += @length if i < 0 | |
i = 0 if i < 0 | |
n = @length | |
while i < 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
likes = Article.likes | |
hash = Hash.new(0) | |
likes.each do |like| | |
hash[like.type] += 1 | |
end | |
hash |