Skip to content

Instantly share code, notes, and snippets.

View runlevel5's full-sized avatar

Trung Lê runlevel5

View GitHub Profile
@morhekil
morhekil / nginx.conf
Created August 14, 2014 12:18
Full request/response body logging in nginx
http {
log_format bodylog '$remote_addr - $remote_user [$time_local] '
'"$request" $status $body_bytes_sent '
'"$http_referer" "$http_user_agent" $request_time '
'<"$request_body" >"$resp_body"';
lua_need_request_body on;
set $resp_body "";
body_filter_by_lua '
@jodosha
jodosha / entity_initialize_indifferent_access.rb
Last active August 29, 2015 14:12
Lotus::Entity#initialize bench: metaprogramming vs iterative
#!/usr/bin/env ruby
require 'rubygems'
require 'benchmark/ips'
require 'lotus/utils/attributes'
class MetaProgrammingEntity
def initialize(attributes = {})
attributes = Lotus::Utils::Attributes.new(attributes)
@a = attributes.get(:a)
@cjheath
cjheath / cql.rake
Created December 6, 2018 04:19
lib/tasks/cql.rake for a Rails Application
namespace 'cql' do
APPLICATION = 'my-app-name'
desc 'Check that there are no errors in CQL'
task :check do
system <<-END
set -x
cd "db/app"
schema_compositor --binary #{APPLICATION}.cql
END