Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env python
#
# Copyright (C) 2014 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
@pcarlisle
pcarlisle / postgresql.conf
Created December 3, 2014 22:05
postgresql.conf
# size - kB MB GB
# time - ms s min h d
max_connections = 100 # (change requires restart)
shared_buffers = 2GB # ~ 1/4 total ram
work_mem = 4MB # per active search, take into account max_connections
maintenance_work_mem = 64MB
max_stack_depth = 6MB
WITH btree_index_atts AS (
SELECT nspname, relname, reltuples, relpages, indrelid, relam,
regexp_split_to_table(indkey::text, ' ')::smallint AS attnum,
indexrelid as index_oid
FROM pg_index
JOIN pg_class ON pg_class.oid=pg_index.indexrelid
JOIN pg_namespace ON pg_namespace.oid = pg_class.relnamespace
JOIN pg_am ON pg_class.relam = pg_am.oid
WHERE pg_am.amname = 'btree'
),
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans
Puppet::Face.define(:curl, '0.0.1') do
summary "Make HTTP requests against the puppet master"
examples <<-EXAMPLES
% puppet curl /production/status/node --accept yaml
--- !ruby/object:Puppet::Status
expiration: 2013-01-10 12:23:47.242323 -08:00
status:
is_alive: true
EXAMPLES
@pcarlisle
pcarlisle / binary_search_specs.rb
Created May 30, 2012 05:48 — forked from nicklewis/binary_search_specs.rb
Binary search for order-dependent test failures
#!/usr/bin/env ruby
specs_in_order = File.read('spec_order').split
failing_spec = ARGV.first
specs = specs_in_order[0...specs_in_order.index(failing_spec)]
suspects = specs
diff --git a/util.c b/util.c
index 40104db..708f858 100644
--- a/util.c
+++ b/util.c
@@ -949,23 +949,25 @@ Exactly one of IEEE_LITTLE_ENDIAN, IEEE_BIG_ENDIAN, VAX, or IBM should be define
typedef union { double d; ULong L[2]; } U;
#ifdef YES_ALIAS
-#define dval(x) x
-#ifdef IEEE_LITTLE_ENDIAN
@pcarlisle
pcarlisle / gist:2210872
Created March 27, 2012 00:06
for running puppet
export ENVPUPPET_BASEDIR="$HOME/work"
eval `$HOME/work/puppet/ext/envpuppet`
# Puppet testing commands
testdir="$HOME/work/test"
function client() {
puppet $* --confdir=$testdir/conf/client --vardir=$testdir/var/client
}
diff -r -u ruby-1.8.5-p231/ext/openssl/extconf.rb ruby-1.8.5-p231-fixed/ext/openssl/extconf.rb
--- ruby-1.8.5-p231/ext/openssl/extconf.rb 2007-02-13 08:01:19.000000000 +0900
+++ ruby-1.8.5-p231-fixed/ext/openssl/extconf.rb 2010-07-13 02:18:18.000000000 +0800
@@ -1,5 +1,5 @@
=begin
-= $RCSfile: extconf.rb,v $ -- Generator for Makefile
+= $RCSfile$ -- Generator for Makefile
= Info
'OpenSSL for Ruby 2' project