This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log /dev/log local0 | |
log /dev/log local1 notice | |
chroot /var/lib/haproxy | |
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners | |
stats timeout 30s | |
user haproxy | |
group haproxy | |
daemon | |
tune.ssl.default-dh-param 2048 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Copy/paste this file or execute with `psql -f thisfile.sql` | |
CREATE ROLE owner CREATEDB LOGIN ENCRYPTED PASSWORD 'secret' CONNECTION LIMIT 3; | |
ALTER ROLE owner SET statement_timeout = 20000; | |
ALTER ROLE owner SET lock_timeout = 3000; | |
ALTER ROLE owner SET idle_in_transaction_session_timeout = 3000; -- v9.6+ | |
CREATE ROLE readwrite_users NOLOGIN; | |
CREATE ROLE readonly_users NOLOGIN; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE ROLE owner LOGIN ENCRYPTED PASSWORD 'secret' CONNECTION LIMIT 3; | |
ALTER ROLE owner SET statement_timeout = 20000; | |
ALTER ROLE owner SET lock_timeout = 3000; | |
ALTER ROLE owner SET idle_in_transaction_session_timeout = 3000; -- v9.6+ | |
CREATE ROLE readwrite_users NOLOGIN; | |
CREATE ROLE readonly_users NOLOGIN; | |
CREATE DATABASE exampledb WITH OWNER owner ENCODING UTF8 LC_COLLATE 'en_US.UTF-8' LC_CTYPE 'en_US.UTF-8'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import psycopg2 | |
conn = psycopg2.connect("") | |
cur = conn.cursor() | |
# now you can run queries | |
# cur.execute("SELECT 1") | |
# See http://initd.org/psycopg/docs/usage.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Resources: | |
SampleBucket: | |
Type: "AWS::S3::Bucket" | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlayerShard < ActiveRecord::Base | |
def self.with_date(date) | |
current_table_name = self.table_name | |
self.table_name = self.shard_table_name(date) | |
create_shard(date) | |
yield | |
ensure | |
self.table_name = current_table_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var safe = Handlebars.SafeString; | |
Em.Handlebars.helper('bound-avatar', function(user, size, uploadId) { | |
if (Em.isEmpty(user)) { | |
return new safe("<div class='avatar-placeholder'></div>"); | |
} | |
var username = Em.get(user, 'username'); | |
if(arguments.length < 4){ | |
uploadId = Em.get(user, 'uploaded_avatar_id'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "yajl" | |
require "openssl" | |
require "socket" | |
device_token = '39cac56f 986a0e66 3c4fd4f4 68df5598 024d2ca3 8b9f307c 741c180e 9fc30c62' | |
device_token = device_token.gsub(" ", "") | |
the_byte_token = [device_token].pack("H*") | |
file = File.open("ruby_the_byte_token", "wb") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while : | |
do | |
building=`bulldozer images:list | grep postprocessor-2012-05-29 | grep available | wc -l` | |
if [ $building -eq 1 ] | |
then | |
say "post processor image finished building" | |
break | |
fi | |
sleep 5 | |
done |
NewerOlder