Skip to content

Instantly share code, notes, and snippets.

@blueplanet
blueplanet / file0.js
Created March 3, 2014 22:05
StackEditでvim/emacsキーバインド設定 ref: http://qiita.com/blueplanet/items/da836ad23889c2877cc8
userCustom.onReady = function() {
var ace = {}
ace.require = require
ace.define = define
ace.require(["ace/lib/net"], function(acenet) {
acenet.loadScript("//cdn.jsdelivr.net/ace/1.1.01/min/keybinding-vim.js", function() {
e = document.querySelector(".ace_editor").env.editor
ace.require(["ace/keyboard/vim"], function(acevim) {
e.setKeyboardHandler(acevim.handler);
@blueplanet
blueplanet / file0.txt
Created April 25, 2014 06:30
プロセスタイムアウト時間を変更する ref: http://qiita.com/blueplanet/items/3de1618784a904cd4f4c
export POW_TIMEOUT=300
export POW_WORKERS=3
@blueplanet
blueplanet / _project.html.erb
Created July 4, 2014 10:05
モデル関連の階層が2層以上ある場合のincludes設定 ref: http://qiita.com/blueplanet/items/05aa424cc7e5847e6c84
<li>
<%= project.name %>
<ul>
<%= render project.tasks %>
</ul>
</li>
@blueplanet
blueplanet / file0.txt
Created July 21, 2014 06:04
respond_with について調べてみた ref: http://qiita.com/blueplanet/items/9587b31f1805d80fd4c3
it "re-renders the 'new' template" do
# Trigger the behavior that occurs when invalid params are submitted
Journal.any_instance.stub(:save).and_return(false)
post :create, {:journal => { "title" => "invalid title" }}, valid_session
response.should render_template(:new)
end
it "re-renders the 'edit' template" do
journal = Journal.create! valid_attributes
# Trigger the behavior that occurs when invalid params are submitted
package edu;
public class Kadai3 {
public static void main(String[] args) {
int origin[][] = new int[][] {{ 1, 2, 3 }, { 4, 5, 6 }};
printArray("変換前", origin);
int toSize1[] = new int[] {3, 2};
int toArray1[][] = convert(origin, toSize1);
@blueplanet
blueplanet / keymap.cson
Last active August 29, 2015 14:09
atom keymap
'atom-workspace atom-text-editor:not(.mini)':
'ctrl-cmd-[': 'editor:fold-current-row'
'ctrl-cmd-]': 'editor:unfold-current-row'
'.editor.vim-mode:not(.insert-mode)':
'z c': 'editor:fold-current-row'
'z C': 'editor:fold-all'
'z o': 'editor:unfold-current-row'
'z O': 'editor:unfold-all'
'.editor':
@blueplanet
blueplanet / file0.txt
Created November 18, 2014 21:25
MacOS 10.10 + tmuxでコマンドラインでatomを実行できない件の対応方法 ref: http://qiita.com/blueplanet/items/d4d2520c447ca4c05297
brew install reattach-to-user-namespace
Benchmark Run: Fri Nov 28 2014 20:13:53 - 20:42:07
32 CPUs in system; running 1 parallel copy of tests
Dhrystone 2 using register variables 33916956.0 lps (10.0 s, 7 samples)
Double-Precision Whetstone 4419.0 MWIPS (9.8 s, 7 samples)
Execl Throughput 2832.8 lps (29.7 s, 2 samples)
File Copy 1024 bufsize 2000 maxblocks 898613.6 KBps (30.0 s, 2 samples)
File Copy 256 bufsize 500 maxblocks 248292.9 KBps (30.0 s, 2 samples)
File Copy 4096 bufsize 8000 maxblocks 1925824.9 KBps (30.0 s, 2 samples)
Pipe Throughput 1206604.8 lps (10.0 s, 7 samples)
@blueplanet
blueplanet / file0.rb
Created December 9, 2014 06:00
FactoryGirlのattributes_forがassociationを生成してくれない ref: http://qiita.com/blueplanet/items/82a349f99d0faa925a85
# model
class Group
has_many :users
end
class User
belongs_to :group
validates :group_id, presence: true
end
@blueplanet
blueplanet / file0.txt
Created December 24, 2014 21:41
TravisCIのDocker対応を試してみました ref: http://qiita.com/blueplanet/items/e27bed2c23f02b82a8ff
...
sudo: false
cache: bundler
...