Skip to content

Instantly share code, notes, and snippets.

View soramugi's full-sized avatar
🦭
I always want to lie down

Y.Tsuyuzaki soramugi

🦭
I always want to lie down
View GitHub Profile
@rummelonp
rummelonp / grep.rb
Last active August 29, 2015 13:56
Homebrew で grep 2.18 入れるやつ
require 'formula'
class Grep < Formula
url 'http://ftp.gnu.org/gnu/grep/grep-2.18.tar.xz'
sha1 'fdb12580714966745635da7d9db55060f88db28b'
version '2.18'
depends_on 'pcre'
def install
@rummelonp
rummelonp / application.rb
Last active August 29, 2015 14:06
Rails のジェネレータで使わない奴生成しないようにするやつ
# これを config/application.rb 内にコペピする
# 参考: http://guides.rubyonrails.org/generators.html#customizing-your-workflow-by-changing-generators-templates
config.generators do |g|
g.controller helper: false, assets: false
g.rspec view_specs: false, helper_specs: false
end
@antage
antage / install-rbenv-user.sh
Created December 1, 2011 14:56
System wide install rbenv on Debian
#!/bin/bash
# per-user install
echo 'if [ -z "$(type rbenv 2> /dev/null | head -1 | grep function)" ]; then' >> ~/.bashrc
echo ' export RBENV_ROOT=/usr/local/rbenv' >> ~/.bashrc
echo ' export PATH=$RBENV_ROOT/bin:$PATH' >> ~/.bashrc
echo ' eval "$(rbenv init -)"' >> ~/.bashrc
echo 'fi' >> ~/.bashrc
@show555
show555 / .htaccess
Created March 15, 2012 01:05
Basic認証下でWP Cronを動かす
# Exclude the file upload and WP CRON scripts from authentication
<FilesMatch "(async-upload\.php|wp-cron\.php|xmlrpc\.php)$">
Satisfy Any
Order allow,deny
Allow from all
Deny from none
</FilesMatch>
@thinca
thinca / neobundle
Created August 22, 2012 02:14
neobundle command
#!/bin/sh
if [ -z "$1" ]; then
echo Usage: $0 {config-file}
exit
fi
vim -N -u NONE -i NONE -V1 -e -s --cmd "source $1" --cmd NeoBundleInstall! --cmd qall!
@ntotani
ntotani / tweetZombie.coffee
Created September 6, 2012 14:10
tweet message by Zombie.js
Browser = require "zombie"
username = process.argv[2]
password = process.argv[3]
message = process.argv[4]
browser = new Browser (debug:true, runScripts:false)
browser.visit "https://mobile.twitter.com/session/new", ->
browser.fill "username", username
browser.fill "password", password
@rummelonp
rummelonp / suddenize
Last active December 11, 2015 06:08
突然の死
#!/usr/bin/env bash
function suddenize() {
typeset text hit length i header footer
text=$1
hit=0
for i in $( seq 1 ${#text} ); do
hit=$(( $hit + $(expr $text[$i] : '[ -~]') ))
done
length=$(( ${#text} - $(( $hit / 2 )) + 2 ))
@rummelonp
rummelonp / homebrew_sushi.patch
Created February 14, 2013 10:52
Homebrew インストール後に寿司表示するやつ
diff --git Library/Homebrew/formula_installer.rb Library/Homebrew/formula_installer.rb
index 1008bc2..3cf2492 100644
--- Library/Homebrew/formula_installer.rb
+++ Library/Homebrew/formula_installer.rb
@@ -236,7 +236,7 @@ class FormulaInstaller
ohai "Summary" if ARGV.verbose? or show_summary_heading
unless ENV['HOMEBREW_NO_EMOJI']
- print "🍺 " if MacOS.version >= :lion
+ print "🍣 " if MacOS.version >= :lion
require 'RMagick'
require 'capybara'
require 'launchy'
module Capybara::Recording
def start_recording
system "rm -f tmp/*"
end
def save_recording
@STAR-ZERO
STAR-ZERO / gist:5335577
Last active December 15, 2015 22:49
HomebrewでMySQLのバージョンを指定して入れる

HomebrewでMySQLのバージョンを指定して入れる

$ cd /usr/local
$ brew versions mysql
5.6.10   git checkout aa3db07 Library/Formula/mysql.rb
5.5.29   git checkout 336c976 Library/Formula/mysql.rb
5.5.28   git checkout 5825f62 Library/Formula/mysql.rb
5.5.27   git checkout 93aecfa Library/Formula/mysql.rb
5.5.25a git checkout faaa6c1 Library/Formula/mysql.rb