This file contains hidden or 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
| setHook(packageEvent("grDevices", "onLoad"), | |
| function(...){ | |
| if(.Platform$OS.type == "windows") | |
| grDevices::windowsFonts(sans ="MS Gothic", | |
| serif="MS Mincho", | |
| mono ="FixedFont") | |
| if(capabilities("aqua")) | |
| grDevices::quartzFonts( | |
| sans =grDevices::quartzFont( | |
| c("Hiragino Kaku Gothic Pro W3", |
This file contains hidden or 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
| getQueryVariable = (variable) -> | |
| query = root.location.search.substring(1) | |
| pairStrings = query.split('&') | |
| for pairString in pairStrings | |
| pair = pairString.split("=") | |
| if pair[0] == variable | |
| return unescape(pair[1]) | |
| console.log("WARN: #{variable} is not found in query string") |
This file contains hidden or 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 | |
| set -e | |
| set -u | |
| SOLR_DIRNAME="apache-solr-3.5.0" | |
| SOLR_URL="http://tonchidot.s3.amazonaws.com/projects/NewSC/Server-Dev/apache-solr-3.5.0.tar.gz" | |
| INSTALL_DIR="/usr/local/solr" | |
| SCRIPT_FILE="$HOME/bin/start_solr.sh" | |
| cd /tmp |
This file contains hidden or 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
| PATH="$PATH:/usr/local/go/bin" | |
| export GOBIN="$HOME/bin" | |
| export PATH=$PATH:$HOME/bin | |
| export GOPATH=/tmp | |
| go get -u github.com/nsf/gocode | |
| cd $GOPATH/src/github.com/nsf/gocode/vim/ | |
| ./update.bash |
This file contains hidden or 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 'rake' | |
| dependency = { | |
| 'all' => ['attr 1', 'attr 2', 'attr 3', 'attr 5'], | |
| 'attr 1' => ['attr 2', 'attr 3'], | |
| 'attr 2' => ['attr 5'], | |
| 'attr 3' => [], | |
| 'attr 5' => [], | |
| } |
This file contains hidden or 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
| class Hash | |
| def recursive_symbolize_keys! | |
| symbolize_keys! | |
| values.select { |v| v.is_a? Hash }.each { |h| h.recursive_symbolize_keys! } | |
| self | |
| end | |
| def recursive_symbolize_keys | |
| dup.recursive_symbolize_keys! | |
| end |
This file contains hidden or 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
| def rand_string(length=16) | |
| chars = [*('A'..'Z'), *('a'..'z'), *(0..9)] | |
| (0..length).map {chars.sample}.join | |
| end |
This file contains hidden or 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 | |
| $:.push File.join(File.dirname(__FILE__), "../lib") | |
| require 'pry' | |
| require 'mylibrary' | |
| binding.pry quiet: true |
This file contains hidden or 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
| module Const | |
| ABC = 1 | |
| module CategoryX | |
| XYZ = 2 | |
| end | |
| # Gon で JavaScript, CoffeeScript に渡せるように定数を hash に変換する | |
| # @param [Module] target | |
| def to_hash(target = self) |
This file contains hidden or 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
| # coding: UTF-8 | |
| class GitUtil | |
| class << self | |
| # Current source code revision | |
| def revision | |
| rev = capistrano_revision | |
| rev = command_revision unless rev | |
| rev.try(:chomp) | |
| end |