Skip to content

Instantly share code, notes, and snippets.

View yuki24's full-sized avatar
🔢
NaN :trollface:

Yuki Nishijima yuki24

🔢
NaN :trollface:
View GitHub Profile

Your Rails Config

config.i18n.railties_load_path

no docs for i18n.railties_load_path found in rails guides

["/Users/schneems/.gem/ruby/2.1.2/gems/will_paginate-3.0.4/lib/will_paginate/locale/en.yml", "/Users/schneems/.gem/ruby/2.1.2/gems/devise-3.2.4/config/locales/en.yml", "/Users/schneems/Documents/projects/codetriage/config/locales/devise.en.yml", "/Users/schneems/Documents/projects/codetriage/config/locales/en.yml"]
@dutc
dutc / Makefile
Last active August 29, 2015 14:08
Did you mean? in Python (Bonus Round!)
CC=gcc -std=c99 -Wall
didyoumean.so: didyoumean.c didyoumean-safe.c
${CC} `python-config --cflags` `python-config --includes` -Wl,--export-dynamic -fPIC -shared -o $@ $^ -ldl `python-config --libs`
@keijiro
keijiro / test.md
Last active August 29, 2015 14:09

GitHubギッハブ Flavoredフレイヴァード Markdownマークダウン においては ruby タグを用もちいる事ことで漢かん字じに紅ル玉ビを振ふる事ことが可能なできるのだッッ!!!

@irrationalidiot
irrationalidiot / description
Created April 5, 2011 14:13 — forked from jacortinas/description
Cucumber, rspec and spork setup using watchr for rails
Gems:
gem 'cucumber'
gem 'cucumber-rails'
gem 'rspec'
gem 'rspec-rails'
gem 'capybara'
gem 'database_cleaner'
gem 'spork'
gem 'watchr'
@btaitelb
btaitelb / .bashrc
Created October 13, 2011 01:05
jenkins .bashrc w/ rvm
~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
if [[ -n "$PS1" ]] ; then
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
@durran
durran / moped.txt
Created February 16, 2012 10:59
First run perf numbers, Moped.
##################################################################
# ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]
# 10gen: mongo-1.5.2
# bson-1.5.2 (BSON::BSON_C)
##################################################################
user system total real
10gen: insert 10,000 blank documents 0.670000 0.060000 0.730000 ( 0.744400)
10gen: insert 10,000 blank documents safe mode 1.200000 0.140000 1.340000 ( 1.800714)
10gen: insert 1,000 normal documents 0.090000 0.010000 0.100000 ( 0.091035)
@jbrechtel
jbrechtel / project.scala
Created May 6, 2012 17:32
Scala Android project with Proguard and ActionBarSherlock
import scala.xml.{Node => XmlNode}
import scala.xml._
import java.io.FileWriter
import sbt._
import Keys._
import AndroidKeys._
@lstoll
lstoll / JettyLauncher.scala
Created September 11, 2011 07:13
Scalatra on Heroku
/*
* Starts jetty for scalatra programatically
*
* Replace YourApplicationEndpointFilter with the filter in your application
*/
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.servlet.{DefaultServlet, ServletContextHandler}
object JettyLauncher {
def main(args: Array[String]) {
@dutc
dutc / didyoumean-excepthook.py
Created October 23, 2014 16:24
Did you mean? in Python
#!/usr/bin/env python
from re import search
from itertools import chain
# levenshtein
def distance(x, y):
if not len(x): return len(y)
if not len(y): return len(x)
return min(distance(x[1:], y[1:]) + (x[0] != y[0]), distance(x[1:], y) + 1, distance(x, y[1:]) + 1)
@fallwith
fallwith / http_headers_dump.rb
Created January 28, 2011 20:41
Rails controller code to dump raw HTTP headers from a request
logger.warn "*** BEGIN RAW REQUEST HEADERS ***"
self.request.env.each do |header|
logger.warn "HEADER KEY: #{header[0]}"
logger.warn "HEADER VAL: #{header[1]}"
end
logger.warn "*** END RAW REQUEST HEADERS ***"