Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Hire me!

OKURA Masafumi okuramasafumi

:octocat:
Hire me!
View GitHub Profile
View rails_helper.rb
# デフォでコメントアウトされてるの外すだけ
Dir[Rails.root.join('spec', 'support', '**', '*.rb')].each { |f| require f }
RSpec.configure do |config|
config.include WaitFor
end
View asakusa.rb
def give_ujihisa_money(users, value)
# users[:ujihisa][:money] = 24
update_in2(-> { users[:ujihisa][:money] }, 24)
# put_in(users[:ujihisa][:money], 24)
# dig <-> bury
end
def update_in2(f, value)
pp RubyVM::InstructionSequence.of(f).to_a
nil
@jamieparfet
jamieparfet / macOS-mojave-iso.sh
Last active Dec 19, 2020
Create an ISO from the mojave installer app
View macOS-mojave-iso.sh
#!/bin/bash
# This assumes that the ~6GB mojave installer is in the /Applications folder.
# If it's not, just open the App Store, search Mojave, and you can download the installer file from there.
hdiutil create -o /tmp/mojave.cdr -size 6g -layout SPUD -fs HFS+J
hdiutil attach /tmp/mojave.cdr.dmg -noverify -mountpoint /Volumes/install_mojave
sudo /Applications/Install\ macOS\ mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_mojave
mv /tmp/mojave.cdr.dmg ~/Desktop/InstallSystem.dmg
hdiutil detach /Volumes/Install\ macOS\ mojave
@antifuchs
antifuchs / iterm2_zsh_init.zsh
Last active May 19, 2018
tmux-enabled iterm2 shell integration for zsh.
View iterm2_zsh_init.zsh
if [[ -o login ]]; then
TMUX_PREFIX=""
if [[ ! -z "$TMUX" ]] ; then
# Via
# <http://blog.yjl.im/2014/12/passing-escape-codes-for-changing-font.html>:
TMUX_PREFIX='\ePtmux;\e'
TMUX_POSTFIX='\e\\'
fi
# Indicates start of command output. Runs just before command executes.
@shunirr
shunirr / README.md
Created Aug 30, 2012 — forked from laiso/README
Jenkins をOS X のログインユーザー権限のデーモンで自動起動しておく設定
View README.md

Jenkins をOS X のログインユーザー権限のデーモンで自動起動しておく設定

必要なもの

うっかり jenkins.pkg を入れてしまった人はアンインストールする

@rf-
rf- / validator.rb
Created Apr 6, 2012
Demonstrate validation of arbitrary fields (e.g., hstore)
View validator.rb
#!/usr/bin/env ruby
require 'active_record'
ActiveRecord::Base.establish_connection(
:adapter => 'sqlite3',
:database => ':memory:'
)
ActiveRecord::Schema.define do
You can’t perform that action at this time.