$ ruby extconf.rb
$ make
$ ruby test.rb
$ mkdir ~/ssl
$ cd ~/ssl
$ openssl genrsa -out localhost.key 2048
$ openssl req -new -x509 -key localhost.key -out localhost.crt -days 3650 -subj /CN=localhost
$ sudo security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain localhost.crt
$ brew install nginx
$ cp ~/ssl/localhost.crt /opt/boxen/homebrew/etc/nginx/cert.pem
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 python | |
import SimpleHTTPServer | |
import SocketServer | |
import argparse | |
parser = argparse.ArgumentParser(description='http_server.') | |
parser.add_argument('-p', help='port number', default=8000) | |
parser.add_argument('-b', help='bind address', default="127.0.0.1") |
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
require 'erubis' | |
template = <<'END' | |
<%= Time.now %> | |
<%= ::Time.now %> | |
<%= "string gsub".gsub!(//, '') %> | |
## Hello <%= @user %>! | |
<% for item in @list %> | |
- <%= item %> |
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
cd cocos2d | |
git checkout v3 | |
git pull | |
./download-deps.py |
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
GC.disable | |
before = `ps -o rss= -p #{Process.pid}`.to_i | |
require 'bundler/setup' | |
require 'mini_magick' | |
OUTPUT = "output.png" | |
MATERIAL = "material.png" | |
FONT_PATH = '/Library/Fonts/Osaka.ttf' | |
BACKGROUND_COLOR = "#000000" |
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
#!/bin/bash | |
FROM="山田_太郎" | |
POSTAL1="5_4_1" | |
POSTAL2="0_0_4_4" | |
ADDR1="大阪市_中央区" | |
ADDR2="伏見町_4-4-9" | |
TEL1="06" | |
TEL2="7878" | |
TEL3="6838" | |
TO="吉田_篤" |
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
require 'net/imap' | |
imap = Net::IMAP.new('imap.gmail.com', 993, true) | |
imap.login(ENV["GMAIL_USER"], ENV["GMAIL_PASSWORD"]) | |
imap.select("Inbox") | |
listprefix = "[Imap]/" | |
listname = "PROCESSED" | |
unless imap.list(listprefix, listname) | |
imap.create("#{listprefix}#{listname}") |
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
#!/bin/bash | |
APP_NAME=$1 | |
if [ -z "$APP_NAME" ];then | |
echo "Usage: create_cocos app_name" | |
exit 1 | |
fi | |
COCOS="cocos2d-x/tools/cocos2d-console/bin/cocos" | |
COCOS_TEMPLATE="$(pwd)/cocos2d-x/tools/cocos2d-console/plugins/plugin_generate/bin-templates/cpp-template-default/res-portrait" |
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
# config/initializers/active_record_save_scope_names.rb | |
ActiveSupport.on_load(:active_record) do | |
module SaveScopeNames | |
extend ActiveSupport::Concern | |
module ClassMethods | |
attr_reader :scope_names | |
def scope(*args) | |
@scope_names ||= [] | |
@scope_names << :"#{self.name.downcase}##{args.first}" | |
super |