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 | |
spec_hits = [] | |
checks = { | |
'_spec\.rb$' => ['focus:[:space:]*true'], | |
'\.rb$' => ['binding\.pry', 'debugger'] | |
} | |
# Find the names of all the filenames that have been (A)dded (C)opied or (M)odified | |
filenames = `git diff --cached --name-only --diff-filter=ACM`.split("\n") |
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
<!doctype html> | |
<html lang='ja'> | |
<head> | |
<title>カレーのレシピ</title> | |
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'> | |
</head> | |
<body> | |
<article> | |
<header> | |
<h1>カレーのレシピ</h1> |
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
var parent = { | |
name: "Papa" | |
}; | |
var child = object(parent); | |
alert(child.name); | |
function object(o) { | |
function F() {} | |
F.prototype = o; |
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
Show hidden characters
[ | |
{ "keys": ["ctrl+shift+j"], "command": "js_run" }, | |
{ "keys": ["super+ctrl+shift+`"], "command": "toggle_side_bar" }, | |
{ "keys": ["ctrl+super+`"], "command": "focus_side_bar" }, | |
{ "keys": ["ctrl+shift+t"], "command": "delete_trailing_spaces" }, | |
{ "keys": ["super+alt+["], "command": "reindent" }, | |
{ "keys": ["ctrl+shift+."], "command": "erb" }, | |
{ "keys": ["super+ctrl+m"], "command": "list_rails_models" }, |
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
console.log('hi'); | |
window.Todos = Ember.Application.create(); | |
Todos.Todo = Ember.Object.extend({ | |
title: null, | |
isDone: false | |
}); | |
Todos.todosController = Ember.ArrayController.create({ | |
content:[], |
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
arr = [10,9,9,8,8,6,5] | |
arr.map{|i| arr.index(i) + 1} | |
# => [1, 2, 2, 4, 4, 6, 7] |
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
# sort | |
list.sort((a, b) -> return a.attr1-b.attr1 || a.attr2-b.attr2) | |
# sleep | |
Sleep = (ms) -> | |
d1 = new Date().getTime() | |
d2 = new Date().getTime() | |
d2 = new Date().getTime() while d2 < (d1 + ms) | |
return |
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
"MailCatcher" http://mailcatcher.me/ | |
mocksmtpd |
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
# 1 | |
(rand(900000000)+10 ** 9).to_s | |
# 2 | |
([(0..9).to_a]*9).map{|i|i.sample}.join | |
# 3 | |
sprintf("%09d", rand(10 ** 9)) | |
# 4 | |
Array.new(9){ Array(0..9).sample }.join | |
# 5 | |
9.times.map{rand 10}.join |
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
// Sample | |
// http://aaronsaray.com/blog/2010/10/19/jquery-show-password-toggle/ | |
// HTML | |
// <input type="password" name="password" id="password" class="showpassword" /> | |
// <input type="password" name="password_confirmation" id="password_confirmation" class="showpassword" /> | |
// <input type="checkbox" value="1" name="show_password" id="show_password"> | |
// js | |
$(function(){ |