$ cat /etc/apache2/sites-enabled/mms-test
Listen 50690
LogLevel debug
DumpIOInput On
# DumpIOOutput On
$ sudo tail -f /var/log/apache2/error.log | grep "mod_dumpio.c(74)" | sed "s/.*HEAP.: //"
| # remove content of script tags using Sanitize | |
| require 'sanitize' | |
| html = '<p>Do not<script>fail();</script> kill the <a href="/cats/42">cat</a>.</p>' | |
| Sanitize.clean(html, Sanitize::Config::BASIC.merge( | |
| :transformers => lambda { |env| | |
| node = env[:node] | |
| if node.name.downcase == 'script' |
| require "time" | |
| require "date" | |
| class Date | |
| def to_time | |
| Time.local(year, month, day) | |
| end | |
| end | |
| class Time |
| # Forked to get it working with Rails 3 and RSpec 2 | |
| # | |
| # From http://github.com/jaymcgavren | |
| # | |
| # Save this as rcov.rake in lib/tasks and use rcov:all => | |
| # to get accurate spec/feature coverage data | |
| # | |
| # Use rcov:rspec or rcov:cucumber | |
| # to get non-aggregated coverage reports for rspec or cucumber separately |
| # Add this to your gem file | |
| group :production do | |
| gem 'dalli' | |
| gem 'rack-cache', :require => 'rack/cache' | |
| gem 'rack-contrib', :require => 'rack/contrib' | |
| end |
| require 'rubygems' | |
| require 'json' | |
| require 'redis' | |
| class RedisComments | |
| def initialize(redis,namespace,sort_proc=nil) | |
| @r = redis | |
| @namespace = namespace | |
| @sort_proc = sort_proc | |
| end |
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential | |
| apt-get -y install git-core | |
| # Install rbenv | |
| git clone git://github.com/sstephenson/rbenv.git /usr/local/rbenv | |
| # Add rbenv to the path: |
| package main | |
| import ( | |
| "bytes" | |
| "exec" | |
| "log" | |
| "os" | |
| ) | |
| // Pipeline strings together the given exec.Cmd commands in a similar fashion |
| class ActionDispatch::Routing::Mapper | |
| def draw(routes_name) | |
| instance_eval(File.read(Rails.root.join("config/routes/#{routes_name}.rb"))) | |
| end | |
| end | |
| BCX::Application.routes.draw do | |
| draw :api | |
| draw :account | |
| draw :session |
| # Oona Rรคisรคnen 2013 | |
| # http://windytan.com | |
| # ssh-keygen -l -f ~/.ssh/id_rsa.pub | perl emoji.pl | |
| @emoji = qw( ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ฐ ๐ฑ ๐ฒ ๐ณ ๐ด ๐ต ๐ท ๐ธ | |
| ๐น ๐บ ๐ป ๐ผ ๐ฝ ๐พ ๐ฟ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ | |
| ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ ๐ | |
| ๐ ๐ ๐ ๐ ๐ ๐ก ๐ข ๐ฃ ๐ค ๐ฅ ๐ฆ ๐ง ๐จ ๐ฉ ๐ช ๐ซ | |
| ๐ฌ ๐ญ ๐ฎ ๐ฏ ๐ฐ ๐ฑ ๐ฒ ๐ณ ๐ด ๐ต ๐ถ ๐ท ๐ธ ๐น ๐บ ๐ป |