Skip to content

Instantly share code, notes, and snippets.

View bkw's full-sized avatar

Bernhard Weisshuhn (a.k.a. bernhorst) bkw

View GitHub Profile
@bkw
bkw / Interesting comment from TextMate blog on similar issue
Created April 2, 2009 21:15
Error messages from gitx running under gnu screen
The best explaination so far: http://blog.macromates.com/2007/leopard-issues/#comment-2887
#!/bin/sh
# mixture of http://www.gitready.com/advanced/2009/02/16/convert-git-svn-tag-branches-to-real-tags.html
# and http://frank.thomas-alfeld.de/wp/2008/08/30/converting-git-svn-tag-branches-to-real-tags/
set -eu
git for-each-ref refs/remotes/svn/tags | cut -f 2- |
while read ref
do
!!! 5
//[if lt IE 7 ]> <html class="no-js ie6" lang="en"> <![endif]
//[if IE 7 ]> <html class="no-js ie7" lang="en"> <![endif]
//[if IE 8 ]> <html class="no-js ie8" lang="en"> <![endif]
//[if (gte IE 9)|!(IE)]><!--> <html class="no-js" lang="en"> <!--<![endif]
head
meta(charset="utf-8")
meta(http-equiv="X-UA-Compatible", content="IE=edge,chrome=1")
title some Title
meta(name="description", content="")
var http = require('http'),
util = require('util');
var options = {
host: 'api.twitter.com',
port: 80,
path: '/1/statuses/public_timeline.json'
};
var chunks = [],
total = 0;
@bkw
bkw / jsconf2011-talks.txt
Created May 6, 2011 07:42 — forked from indexzero/jsconf2011-talks.txt
JSConf talks and resources
Track A
Bytes and Blobs – David Flanagan @__DavidFlanagan
Slides: http://davidflanagan.com/Talks/jsconf11/BytesAndBlobs.html
Conference Wifi Redux - Malte Ubi @cramforce
Sashimi: https://github.com/cramforce/Sashimi
Slides: http://social-traffic.streamie.org/preso/static/#slide1
Run Your JS everywhere with Jellyfish – Adam Christian @admc
@bkw
bkw / test.js
Created July 17, 2012 21:57
difference in behaviour between lodash.js and lodash.min.js
#!/usr/bin/env node
var _ = require('./lodash.js')._,
_min = require('./lodash.min.js')._,
t = '{{ demo.join(",") }}',
data = { demo: ['a', 'b'] };
_.templateSettings = _min.templateSettings = {
interpolate : /\{\{(.+?)\}\}/g
};
@bkw
bkw / no-cache.json
Created July 31, 2012 20:14
HAR of different responses from avatars.io for the same url based on caching pragma
{
"startedDateTime": "2012-07-31T20:11:22.055Z",
"time": 927,
"request": {
"method": "GET",
"url": "http://avatars.io/auto/nelsonmandela?size=large",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Accept-Encoding",
@bkw
bkw / amqp_printr.php
Created September 5, 2012 14:59
Demo of more strangeness with pecl-amqp and print_r
<?php
class Demo {
function __construct($conn) {
$this->someProperty = 'foobar';
$this->channel = new AMQPChannel($conn);
}
}
$conn = new AMQPConnection();
@bkw
bkw / msgpack-issue-2.php
Created September 11, 2012 16:53
msgpack-php#2: segfault during parsing
#!/usr/bin/env php
<?php
msgpack_unserialize(
msgpack_serialize(
unserialize(
file_get_contents(
'http://s3.amazonaws.com/bkw/serialized.ser'
)
)
@bkw
bkw / checkForExchange.php
Created October 3, 2012 16:31
How to check for the existance of an exchange with pecl-amqp
<?php
$conn = new AMQPConnection();
$conn->connect();
$channel = new AMQPChannel($conn);
$exchange = new AMQPExchange($channel);
$exchange->setName('someExchange');
$exchange->setType(AMQP_EX_TYPE_TOPIC);
$exchange->setFlags(AMQP_DURABLE | AMQP_PASSIVE);