Skip to content

Instantly share code, notes, and snippets.

@Epictetus
Epictetus / HAL.rb
Created April 21, 2012 13:31 — forked from shibukawa/HAL.rb
Fuzzy method calling
module HAL
module_function
def calc_weight(index, length)
distance = (length - 1.0 - index) / (length - 1.0)
distance * distance * 0.5 + 1.0
end
def strings_distance(source, target, distance_limit)
if source == target
@Epictetus
Epictetus / smugnessProblem.rst
Created April 19, 2012 15:44 — forked from Gab-km/smugnessProblem.rst
コードウォッチ:関数型プログラミングの自惚れ問題

コードウォッチ:関数型プログラミングの自惚れ問題

原文:http://www.sdtimes.com/link/36534
著者:Larry O'Brien

僕は関数型プログラミングが好きだ。次の10年にかけてコードの革命を起こしていくだろうと考えている:言語はより関数型の機能を採用していくだろうし、開発者はより関数型の技術を導入していくだろうし、いくつかの点では、関数型プログラミングの原則はコードを組み立てていく上で「自然で」もっとも明確なやり方だとみんな考えるようになっていくだろう。

だけど、僕はもうこのシナリオを本気にしちゃいない。関数型プログラミングは、ワクワクするものを学ぶことに興味があると言っている主流のプログラマにとって明白な、大きな問題を抱えている:関数型プログラマーは自惚れ野郎どもだってことだ。

@Epictetus
Epictetus / Gemfile
Created April 9, 2012 09:26 — forked from yhara/Gemfile
test
source 'http://rubygems.org'
gem 'sinatra'
gem 'sinatra-reloader'
gem 'slim'
@Epictetus
Epictetus / gist:2286344
Created April 2, 2012 19:00 — forked from ernesto-jimenez/gist:2286214
Automatically reload your active tab in Chrome. See the comments for instructions.
#!/usr/bin/env osascript
#
# This AppleScript reloads Google Chrome. It can be used in combination kicker
# gem to automatically reload google chrome when you save a file from your app.
#
# Usage for a rails app:
# 1) Place this file in $RAILS_ROOT/script/reload_chrome
# 2) Install the kicker gem: gem install kicker
# 3) Run: kicker -e script/reload_chrome app public
#
@Epictetus
Epictetus / gist:2280016
Created April 2, 2012 02:08 — forked from anonymous/gist:2251911
Worpressインストールスクリプト(CentOS5.7 on さくらのクラウドで動作確認済み)
#!/bin/bash
#===============================================
# Wordpress Settings
#===============================================
##MySQL管理ユーザのパスワード
MYSQL_ROOT_PASS='Passw0rd'
##Wordpressデータベース名
WP_MYSQL_DB_NAME='wordpress'
##WordpressDB管理ユーザ名
@Epictetus
Epictetus / hello.php.rb.py.pl
Created March 31, 2012 00:58
php でも ruby でも python でも perl でも動く Hello World
#<?php /*
print "Hello World!!\n"
#*/ echo ("12"^"9") ?>Hello World!!
@Epictetus
Epictetus / gist:2188762
Created March 24, 2012 22:47 — forked from champierre/gist:2135971
Steps to make Android APK file created by App Inventor publishable
# apktool d -s sample.apk sample
# cd sample
# vi AndroidManifest.xml
- Add android:versionCode="1" to manifest tag
- Add android:versionName="1.0" to manifest tag
- Delete android:debuggable="true" from application tag
# apktool b sample sample-m.apk
# jarsigner -keystore sample.keystore -signedjar sample-s.apk sample-m.apk alias
@Epictetus
Epictetus / output.txt
Created March 22, 2012 14:14 — forked from dchelimsky/output.txt
RSpec is not the reason your rails test suite is slow
[david: compare]$ # at this point we have a stock rails app with no minitest tests and one pending rspec example
[david: compare]$
[david: compare]$ time rake test
Run options:
# Running tests:
Finished tests in 0.030419s, 0.0000 tests/s, 0.0000 assertions/s.
@Epictetus
Epictetus / Gemfile
Created March 22, 2012 14:14 — forked from mbleigh/Gemfile
Non-Rails Rackup with Sprockets, Compass, and Twitter Bootstrap
source "https://rubygems.org"
gem 'sprockets'
gem 'sprockets-sass'
gem 'sass'
gem 'compass'
gem 'bootstrap-sass'
@Epictetus
Epictetus / exec_bash.rb
Created March 20, 2012 22:27 — forked from cosmo0920/exec_bash.rb
Rubyからbash実行?
#bashシェルを埋め込んでみた。
#必要なヘッダーが有る時はなにもしないよ
fixshContent=
"#!/usr/bin/env bash\n
cd arch/x86/include/asm/\n
if [ -f unistd_32.h ] ; then
echo 'no need fix.'
else
ln -s ../generated/asm/unistd*.h .\n
fi"