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 -*- | |
require 'benchmark' | |
require 'hashie/mash' | |
require 'active_support/ordered_options' | |
TIMES = 100000 | |
Benchmark.bm(30) do |x| | |
x.report('Hash') do |
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 -*- | |
source 'https://rubygems.org' | |
gem 'twitter' | |
gem 'natto' |
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
!function($) { | |
var fold = function(object, separator) { | |
object = $.extend({}, object); | |
separator = separator || $.fold.defaults.separator; | |
$.each(object, function(key, value) { | |
if (typeof key === 'string') { | |
var keys = key.split(separator), | |
last = keys.pop(), | |
current = object; |
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 ActiveRecord::Base | |
def self.indexes | |
connection.indexes(table_name) | |
end | |
def self.indexes_by_column(column_name) | |
indexes.select { |i| i.columns.include?(column_name.to_s) } | |
end | |
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
# -*- coding: utf-8 -*- | |
require 'faraday' | |
require 'faraday_middleware' | |
module Vine | |
def self.login(username = ENV['VINE_USERNAME'], password = ENV['VINE_PASSWORD']) | |
data = Vine::Client.new.login(username, password) | |
Vine::Client.new(data['key']) | |
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
# -*- coding: utf-8 -*- | |
module MagicalDefiner | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
def set_instance_variables_from_parameter(*args) | |
args = args.dup | |
method(:initialize).parameters.each do |type, key| |
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 -*- | |
require 'benchmark' | |
require 'MeCab' | |
require 'natto' | |
require 'ffi' | |
# Natto#parse のボトルネック解消したバージョン | |
class DaizuNatto < Natto::MeCab | |
def parse(str) |
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
#compdef mysqlenv | |
# ------------------------------------------------------------------------------ | |
# Description | |
# ----------- | |
# | |
# Completion script for mysqlenv (https://github.com/xaicron/mysqlenv). | |
# | |
# ------------------------------------------------------------------------------ | |
# Authors | |
# ------- |
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 'formula' | |
class TxTrie < Formula | |
homepage 'https://code.google.com/p/tx-trie/' | |
url 'https://tx-trie.googlecode.com/files/tx-0.18.tar.gz' | |
version '0.18' | |
sha1 'de94178a48cd6ba05b32f667b91f3e2edfd4a562' | |
def install | |
system "./configure", "--prefix=#{prefix}" |
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
IDENTIFICATION DIVISION. | |
PROGRAM-ID. HELLOCOBOL. | |
AUTHOR. KAZUYA TAKESHIMA. | |
PROCEDURE DIVISION. | |
DISPLAY "Hello, COBOL!" | |
STOP RUN. |