Skip to content

Instantly share code, notes, and snippets.

@theconektd
theconektd / github.css
Created April 30, 2012 02:11
Github Markdown CSS - for Markdown Editor Preview
body {
font-family: Helvetica, arial, sans-serif;
font-size: 14px;
line-height: 1.6;
padding-top: 10px;
padding-bottom: 10px;
background-color: white;
padding: 30px; }
body > *:first-child {
fizz = function f() {
fizz = function () {
fizz = function () {
fizz = f
return "Fizz"
}
}
}
buzz = function f() {
@Gab-km
Gab-km / github-flow.ja.md
Last active April 25, 2024 04:01 — forked from juno/github-flow.ja.md
GitHub Flow (Japanese translation)
@mollifier
mollifier / zshrc_useful.sh
Last active July 8, 2024 09:22
少し凝った zshrc
# 少し凝った zshrc
# License : MIT
# http://mollifier.mit-license.org/
########################################
# 環境変数
export LANG=ja_JP.UTF-8
# 色を使用出来るようにする
@catoidrobo
catoidrobo / source-highlight.txt
Created December 26, 2013 09:04
Macのlessに色がつくよ source-highlight
mac
$ brew install source-highlight
$ vim .zshrc
追記
export LESSOPEN='| /usr/local/bin/src-hilite-lesspipe.sh %s'
alias less='less -R'
@hiroshiro
hiroshiro / use_return.rb
Created February 28, 2014 19:00
制御構文の条件式ネストを避けるガード節のRubyの構文。良い、悪い例。
# bad
def compute_thing(thing)
if thing[:foo]
update_with_bar(thing)
if thing[:foo][:bar]
partial_compute(thing)
else
re_compute(thing)
end
end
@JunichiIto
JunichiIto / alias_matchers.md
Last active July 18, 2024 15:03
List of alias matchers in RSpec 3

This list is based on aliases_spec.rb.

You can see also Module: RSpec::Matchers API.

matcher aliased to description
a_truthy_value be_truthy a truthy value
a_falsey_value be_falsey a falsey value
be_falsy be_falsey be falsy
a_falsy_value be_falsey a falsy value
@matsubo
matsubo / credit_card_bin_codes.md
Last active June 11, 2024 05:23
Credit Card Bin Codes

概要

クレジットカード番号には法則があり、先頭6桁でカードの種類を識別、分類することができる。

詳細はISO/IEC 7812で規定されている。

ISO/IEC 7812 - Wikipedia https://ja.wikipedia.org/wiki/ISO/IEC_7812

先頭の6桁を銀行識別番号(Bank Identification Number、略称:BIN)ないしは発行者識別番号(Issuer Identification Number、略称:IIN)と呼び、この先頭6桁でカード発行会社(イシュア、issuer)が判るようになっている。

var postMessageRoundTripCounter = 0;
var setTimeoutRoundTripCounter = 0;
startPostMessageLoop = function(){
// var lastPostMessageAt = Date.now()
var receiveMessage = function(message){
if (message.data !== 'postMessageTest') return;
// var delta = Date.now() - lastPostMessageAt;
// console.log('postMessage delta:', delta);
postMessageRoundTripCounter++;
@spiralx
spiralx / object-assign.js
Created July 6, 2015 17:31
Object.assign() browser polyfill
if (!Object.assign) {
Object.defineProperty(Object, 'assign', {
enumerable: false,
configurable: true,
writable: true,
value: function(target) {
'use strict';
if (target === undefined || target === null) {
throw new TypeError('Cannot convert first argument to object');
}