Skip to content

Instantly share code, notes, and snippets.

=== modified file 'clients/memcapable.c'
--- clients/memcapable.c 2010-07-28 18:48:18 +0000
+++ clients/memcapable.c 2010-08-08 21:12:10 +0000
@@ -1869,8 +1869,10 @@
const char *hostname= "localhost";
const char *port= "11211";
int cmd;
+ bool prompt = false;
+ const char *testname= NULL;
RDBMS schema safety tips & common practices...
- define primary keys, even if artificial
- normalize your schema, and denormalize carefully
- use indexes judiciously
- distributed 2PC is a tool best left in the toolbox
- __many more known relational schema and modeling tips & tricks go here, but too lazy to type__
Document database / couchdb "schema" safety tips & common practices...
@steveyen
steveyen / gist:923667
Created April 17, 2011 01:44
sqlite PEG grammar, for PEG.js, sqlite 3.7.6
// originally generated by pegjs, from tmp/rules.rb and bubble-to-pegjs_ex.rb
// and manually edited for pegjs suitability. Rules with indentation
// or with comments have manual edits.
//
start = sql_stmt_list
sql_stmt_list =
( whitespace ( sql_stmt )? whitespace semicolon )+
sql_stmt =
couchbase-single-server-community_x86_2.0.0-dev-preview-3.rpm.install
@steveyen
steveyen / gist:1201110
Created September 7, 2011 17:00
Using TCP_NODELAY with ruby Net HTTP
class MyHTTP < Net::HTTP
def on_connect()
@socket.io.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)
end
end
MyHTTP.new(host, port).start do |http|
for x in 0..n
req = Net::HTTP::Get.new("http://#{host}:#{port}/rest/of/url")
req.add_field('Connection', 'keep-alive')
<html>
<head>
<title>Awesome Game Site</title>
</head>
<body>
<h1>minecraft!</h1>
We love our
<a href="http://www.minecraft.net">
Minecraft!
</a>
#!/usr/bin/env python
import re
import os
import sys
import time
import socket
import threading
# Simple proxy, useful for recording HTTP REST protocol conversations.
-- test usage: lua -l query -e "TEST_nlj(); TEST_scan()"
--
local tinsert = table.insert
local RESULT = 0x0001
local function scan(docs, scan_hints, join_prev, bb, doc_visitor_fun)
for i = 1, #docs do
doc_visitor_fun({ docs[i], join_prev })
end
#!/usr/bin/env python
# fake, pseudocode for an incremental backup client that uses libupr
# and a mythical memcached-binary network library (mcb).
import sys
import sqlite
import uuid
import libupr
@steveyen
steveyen / gist:12da0ae4c2874e2a04ea
Created May 21, 2014 17:47
clojurescript stack overflow
Steves-MacBook-Pro:cbfg steveyen$ lein version
Leiningen 2.3.4 on Java 1.7.0_55 Java HotSpot(TM) 64-Bit Server VM
Steves-MacBook-Pro:cbfg steveyen$ git remote -v
origin git@github.com:steveyen/cbfg.git (fetch)
origin git@github.com:steveyen/cbfg.git (push)
Steves-MacBook-Pro:cbfg steveyen$ git status
On branch master
Your branch is up-to-date with 'origin/master'.