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
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
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
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
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
<!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
#!/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
// This is a manifest file that'll be compiled into application.js, which will include all the files | |
// listed below. | |
// | |
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, | |
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. | |
// | |
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the | |
// compiled file. | |
// | |
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD |
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
<% repo = Grit::Repo.new(Rails.root).head.name rescue nil %> | |
development: | |
adapter: mysql2 | |
encoding: utf8 | |
database: hoge_development<%= "_#{repo}" %> |
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
javascript:var d=document,t=d.title,u=d.URL,i=d.createElement('input');i.value='['+t+']('+u+' )';d.body.appendChild(i);i.focus();i.select(); |