- Scott Chacon on the Interwebs(リンク切れ)
- Scott Chacon on the Interwebs
- GitHub Flow - The best way to use Git and GitHub
31 Aug 2011
githubへ登録 | |
=========== | |
git remote add origin git@github.com:<username>/<application_name>.git | |
git push origin master | |
初期設定 | |
======= | |
git config --global user.name "Foo Bar" | |
git config --global user.email "foo@bar.com" |
// ----------- | |
// Debugger that shows view port size. Helps when making responsive designs. | |
// ----------- | |
function showViewPortSize(display) { | |
if(display) { | |
var height = jQuery(window).height(); | |
var width = jQuery(window).width(); | |
jQuery('body').prepend('<div id="viewportsize" style="z-index:9999;position:fixed;top:40px;left:5px;color:#fff;background:#000;padding:10px">Height: '+height+'<br>Width: '+width+'</div>'); | |
jQuery(window).resize(function() { |
package mail; | |
import java.io.BufferedReader; | |
import java.io.FileInputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.UnsupportedEncodingException; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.Properties; |
## AutoGetter - Twitterで自分のツイートから自分へのリプライをまとめるRubyスクリプト(連ツイまとめ作成用) | |
https://gist.github.com/hyuki0000/85989bcf78d1476d74d3 | |
1. config.yamlを自分用に作成する。 | |
2. ruby autogetter.rb を実行する。 | |
3. 自分へのリプライ(リプライ連鎖)ごとに 1.html, 2.html, 3.html, ... とファイルにまとめる(既存ファイル上書き)。 | |
4. HTMLが直接書けるサイトに貼り付ける。 |
#!/usr/bin/env ruby | |
url = `git config remote.origin.url` | |
puts "BEFORE: #{url}" | |
# https://YOURNAME@example.com/YOURNAME/myrepo.git | |
if url.match(/https:\/\/([^\/@]+@)?([^\/]+)\/([^\/]+)\/(.+)\.git/) | |
optional_login_name, domain, name, repo = $1, $2, $3, $4 | |
cmd = "git remote set-url origin git@#{domain}:#{name}/#{repo}.git" | |
puts cmd |
/** | |
* 任意の桁数に切り取った文字列を返す | |
* 桁数に足りない場合は任意の文字で左側を埋める | |
* | |
* @param {String} val 元の文字 | |
* @param {Number} num 桁数 | |
* @param {String} pad 文字埋めに使用する文字列 | |
* @return {String} 作成した文字列 | |
*/ | |
var padSlice = function(val, num, pad) { |
/** | |
* 文字列を整数にして返す(parseInt) | |
* | |
* 全角の数字は半角にする | |
* 全角ハイフン、全角ダッシュ、全角マイナス記号、長音符は半角ハイフンに変換 | |
* 先頭のマイナス以外のハイフンは削除 | |
* | |
* 「abcd -ー123かー456」→「-123456」 | |
* 「abc123456def」→「123456」 | |
* 「A0000123456」→「123456」 |
package main | |
import ( | |
"flag" | |
"fmt" | |
"image" | |
"image/png" | |
"log" | |
"os" |