Skip to content

Instantly share code, notes, and snippets.

View sanemat's full-sized avatar
🍢

Matt Murahashi Kenichi sanemat

🍢
View GitHub Profile
@nihen
nihen / Isucon.pm
Created August 30, 2011 18:10
isucon nginx embeded
package Isucon;
use 5.14.1;
use Nginx::Simple;
use Text::Xslate::Util qw/html_escape/;
use POSIX qw/strftime/;
use List::Util qw/first/;
use JSON::XS;
use IO::Handle;
use Encode;
@twilson63
twilson63 / testing_with_mocha.md
Created November 25, 2011 22:06
Mocha, Should and Sinon

http://visionmedia.github.com/mocha/

Mocha is a new library from VisionMedia aka TJ Holowaychuk author of ExpressJs. As usual it has everything you can think of from a testing library and manages to keep it simple and straight forward to use.

Just like jasmine it has a very solid bdd style to testing:

#!/usr/bin/env perl
use strict;
use warnings;
use Pod::Usage;
use Text::Markdown 'markdown';
use HTML::TreeBuilder;
use List::Util 'max';
@jugyo
jugyo / gist:1751353
Created February 6, 2012 10:25
the rack middleware that handle the facebook signed request
require 'base64'
require 'openssl'
# This is inspired by [rack-facebook-signed-request](https://github.com/gamesthatgive/rack-facebook-signed-request)
#
# Usage
#
# use Rack::FBSignedRequest, :secret => 'SECRET'
#
class Rack::FBSignedRequest
@kmizu
kmizu / gist:1876800
Last active December 22, 2019 00:05 — forked from gakuzzzz/gist:1865400
Scala環境構築

Scala 開発環境構築手順

前提条件

  • JDKがinstall済みであること
  • java コマンドに環境変数Pathが通っていること
# Rack middleware that drops non properly encoded cookies that would hurt the ActionDispatch::Cookies middleware.
#
# This is actually a hotfix for issues
# * https://github.com/rack/rack/issues/225
# * https://github.com/rails/rails/issues/2622
module CleanCookies
# Tests whether a string may be decoded as a form component
def decodable?(string)
URI.decode_www_form_component(string)
true
@gyndav
gyndav / .travis.yml
Created April 10, 2012 12:57
Simple Mongo PHP Driver extension installer for Travis CI. Works like a charm for other PECL extensions too.
before_script:
- ./path/to/mongo-php-driver-installer.sh
@msng
msng / gist:2468439
Last active October 3, 2015 14:18
Google ドキュメントのフォームから投稿があったら確認メールを自動返信する(日本語版)
/**
* Google ドキュメントのフォームから投稿があったら確認メールを自動返信する(日本語版)
* English version will be available later.
*
* @author Masunaga Ray ( http://www.msng.info/ )
* @instruction http://www.msng.info/archives/2012/04/google-docs-auto-reply.php
*/
function sendConfirmation() {
try {
var ss = SpreadsheetApp.getActiveSpreadsheet();
@chobie
chobie / gist:2493950
Created April 25, 2012 22:19
php-mruby gets started!

php-mruby gets started!

you know mruby is the lightweight implementation of the Ruby language. it also works with php. I made this extension in my lunch time :)

git clone https://github.com/chobie/php-mruby.git --recursive
cd php-mruby
cd mruby
make
@lemieuxster
lemieuxster / Bookmarkified
Created May 2, 2012 18:37
QR Code Bookmarklet
javascript:(function(window, document, undefined) {try {var selectedText = document.getSelection().toString(); if (selectedText === ''){selectedText = window.location.href;} if(selectedText !== ''){var baseQRUrl = 'http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=' + encodeURIComponent(selectedText); window.open(baseQRUrl, '_blank', 'width=400,height=400');}} catch (e) {}})(window, document);