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
#!/bin/bash | |
ORIGIN=$(git remote | grep origin | head -1) | |
NAME=$(git config --get user.name) | |
EMAIL=$(git config --get user.email) | |
if [ -n "$(git remote show ${ORIGIN} | grep 'github.com\|bitbucket.org')" ]; then | |
if [ "${NAME}" = "shunirr" -a "${EMAIL}" = "m@s5r.jp" ]; then | |
exit 0 | |
fi |
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 'nokogiri' | |
def markdown(children) | |
data = [] | |
children.each do |child| | |
case child.node_name | |
when "p", "div" then | |
data << markdown(child.children) |
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 'nokogiri' | |
require 'open-uri' | |
def anchor(children) | |
data = [] | |
children.each do |child| | |
case child.node_name | |
when "p", "div" then |
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
http://ameblo.jp/ogura-yui/image-10302198220-10235474958.html | http://stat.ameba.jp/user_images/20090818/11/ogura-yui/3c/9e/j/o0200026710235474958.jpg | |
---|---|---|
http://ameblo.jp/ogura-yui/image-10302198220-10235474964.html | http://stat.ameba.jp/user_images/20090818/11/ogura-yui/10/7d/j/o0200026710235474964.jpg | |
http://ameblo.jp/ogura-yui/image-10302374961-10235474969.html | http://stat.ameba.jp/user_images/20090818/11/ogura-yui/cb/fe/j/o0200026710235474969.jpg | |
http://ameblo.jp/ogura-yui/image-10302374961-10235474972.html | http://stat.ameba.jp/user_images/20090818/11/ogura-yui/e8/f8/j/o0240032010235474972.jpg | |
http://ameblo.jp/ogura-yui/image-10302786438-10235483910.html | http://stat.ameba.jp/user_images/20090818/12/ogura-yui/a3/cd/j/o0240032010235483910.jpg | |
http://ameblo.jp/ogura-yui/image-10302931649-10216155772.html | http://stat.ameba.jp/user_images/20090719/16/ogura-yui/c5/ef/j/o0020002010216155772.jpg | |
http://ameblo.jp/ogura-yui/image-10302931649-10216155773.html | http://stat.ameba.jp/user_images/20090719/16/ogura-yui/ |
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
o0100016610278596467.jpg | 100 | 166 | |
---|---|---|---|
o0100016610279738540.jpg | 100 | 166 | |
o0100016610279738541.jpg | 100 | 166 | |
o0120016010481949660.jpg | 120 | 160 | |
o0123012311153493237.jpg | 123 | 123 | |
o0124016610224915774.jpg | 124 | 166 | |
o0124016610224919557.jpg | 124 | 166 | |
o0127018010974376068.jpg | 127 | 180 | |
o0127018010974376069.jpg | 127 | 180 | |
o0127018010974376070.jpg | 127 | 180 |
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 | |
# -*- coding: utf-8 -*- | |
class CustomBaseNum | |
def self.convert(value, base_str) | |
base = base_str.size | |
result = '' | |
while true | |
break if value <= 0 | |
remainder = value % base |
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
require 'damerau-levenshtein' | |
module MethodSuggestion | |
def method_missing(name, *args) | |
nearly_methods = methods.sort_by do |m| | |
DamerauLevenshtein.distance(name.to_s, m.to_s) | |
end | |
__send__ nearly_methods[0], *args | |
end | |
end |
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
#!/bin/sh | |
GH_TOKEN=$1 | |
UPLOAD_FILE=$2 | |
GH_USER_NAME=$3 | |
GH_REPO_NAME=$4 | |
VERSION=$5 | |
if [ $# -ne 5 ]; then | |
echo "Invalid arguments." |
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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.7.3' | |
} | |
} | |
project(':modules:volley') { | |
apply plugin: 'android-library' |
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 'mysql2-cs-bind' | |
require 'pit' | |
def get_channel_id(client, name) | |
channel_id = nil | |
client.xquery("SELECT id, name FROM channel WHERE name=?", name).each do |data| | |
channel_id = data['id'] | |
end |