Skip to content

Instantly share code, notes, and snippets.

View kevburnsjr's full-sized avatar

Kevin Burns kevburnsjr

View GitHub Profile
@kevburnsjr
kevburnsjr / gist:824921
Created February 13, 2011 18:27
Is it there or not?
$ curl -i 'http://localhost:8091/riak/bucket?keys=true&props=false'
HTTP/1.1 200 OK
Vary: Accept-Encoding
Server: MochiWeb/1.1 WebMachine/1.7.3 (participate in the frantic)
Link: </riak/bucket/foo2>; riaktag="contained"
Date: Sun, 13 Feb 2011 18:27:22 GMT
Content-Type: application/json
Content-Length: 17
{"keys":["foo2"]}
@kevburnsjr
kevburnsjr / gist:791507
Created January 22, 2011 21:37
Modifying hack to be compatible with fucking pass by reference bullshit
<?php
if ($send_order_emails && !$updated_order->confirmation_sent) {
orders_send_order_emails($shipping, $updated_order, $opsname);
- orders_update(array('confirmation_sent'=>1), array('id'=>$orderid));
+ $fucking_data = array('confirmation_sent'=>1);
+ $fucking_where_clause = array('id'=>$orderid);
+ orders_update($fucking_data, $fucking_where_clause);
}
cd c:\web\loanpair\dev
call git push dev master
call git push stage master
call git push appsrv01 master
call git push appsrv02 master
call git push tasksrv01 master
pause
# Force WWW for http
RewriteCond %{HTTPS} off [NC]
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.?[a-z]{2,6}? [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+)(\.[a-z]{2,6})?$ [NC]
RewriteRule ^(.*)$ http://www.%1%2/$1 [R=301,L]
# Force WWW for https
RewriteCond %{HTTPS} on [NC]
RewriteCond %{HTTP_HOST} !^www\.[a-z-]+\.?[a-z]{2,6}? [NC]
RewriteCond %{HTTP_HOST} ([a-z-]+)(\.[a-z]{2,6})?$ [NC]
/**
* Get the last HTTP response received by this client
*
* If $config['storeresponse'] is set to false, or no response was
* stored yet, will return null
*
* @return Zend_Http_Response or null if none
*/
public function getLastResponse()
{
GET http://domain.tld/issues.json+schema
Status=OK - 200
Content-Type=application/json+schema; schema=http://json-schema.org/schema
{
"description" : "Schema for Resource Issue.",
"type" : "Issue",
"properties" : {
"id" : {
<?php
return array(
'~^/do/(signup|agreement)$~i' => array('controller' => 'default', 'controller_class' => 'DefaultController', '_action' => 1 ),
'~^/([a-zA-Z0-9]+)/photos2$~i' => array('pgo_name' => 1, 'controller' => 'photo', 'controller_class' => 'PhotoController', '_action' => 'index' ),
'~^/([a-zA-Z0-9]+)/photos2/(new|add|create)$~i' => array('pgo_name' => 1, 'controller' => 'photo', 'controller' => 'PhotoController', '_action' => 2),
'~^/([a-zA-Z0-9]+)/photos2/([0-9]+)$~i' => array('pgo_name' => 1, 'controller' => 'photo', 'controller' => 'PhotoController', '_action' => 'show', 'id' => 2),
'~^/([a-zA-Z0-9]+)/photos2/([0-9]+)/(edit|update|remove|delete)$~i' => array('pgo_name' => 1, 'controller' => 'photo', 'controller' => 'PhotoController', 'id' => 2, '_action' => 3 ),
'~^/([a-zA-Z0-9]+)/tags$~i' => array('pgo_name' => 1, 'controller' => 'tag', 'controller_class' => 'TagController', '_action' => 'index' ),
'~^/([a-zA-Z0-9]+)/tags/([a-zA-Z0-9+_:-]+)$~i' => array('pgo_name' => 1, 'control
~~~ Benchmarking
httperf --client=0/1 --server=bench.kevburnsjr.com --port=80 --uri=/projects/recess-0.2/index.php --send-buffer=4096 --recv-buffer=16384 --num-conns=100 --num-calls=1
Maximum connect burst length: 1
Total: connections 100 requests 100 replies 100 test-duration 0.748 s
Connection rate: 133.7 conn/s (7.5 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 4.0 avg 7.5 max 12.0 median 8.5 stddev 2.5
Connection time [ms]: connect 0.1
Connection length [replies/conn]: 1.000
<?php
$tpl = 'common/navigation';
$appb = new MyAppB();
include($appb->getViewsDir().$tpl.'.php');
?>
1d6a671... HEAD@{0}: checkout: moving from master to head
1d6a671... HEAD@{1}: checkout: moving from 5a5773030b4df3b0aaf6b004c13f6f9629ee9
5a57730... HEAD@{2}: checkout: moving from 2.1.5 to head
5a57730... HEAD@{3}: checkout: moving from 3ddebc214ec376a643bafc3f5139a3b304c96
3ddebc2... HEAD@{4}: checkout: moving from 1d6a671c96bcc603e9052864943c752308159
1d6a671... HEAD@{5}: checkout: moving from master to head
1d6a671... HEAD@{6}: checkout: moving from 2.1.5 to master
5a57730... HEAD@{7}: checkout: moving from master to 2.1.5
1d6a671... HEAD@{8}: checkout: moving from 2.1.4 to master
8789215... HEAD@{9}: checkout: moving from 2.1.5 to 2.1.4