Skip to content

Instantly share code, notes, and snippets.

View zimbatm's full-sized avatar
🦙
nixified

Jonas Chevalier zimbatm

🦙
nixified
View GitHub Profile
From c2217768411c879539142997438580b3dc475270 Mon Sep 17 00:00:00 2001
From: Jonas Pfenniger <jonas@pfenniger.name>
Date: Thu, 13 May 2010 15:24:50 +0200
Subject: [PATCH] FIX: signal unregistration
* Added process.{add,remove}Listener wrappers for signal handling
* Thinner SignalWatcher, using same design as IdleWatcher
* Re-introduced test-signal-unregister test
---
src/node.js | 54 ++++++++++++++++++------
--- fever.php.orig 2010-05-19 15:33:00.000000000 +0000
+++ fever.php 2010-05-19 15:33:03.000000000 +0000
@@ -3438,7 +3438,7 @@
$has_href = $link->has_attr('href');
$has_rel = $link->has_attr('rel');
$has_xml_base = $parent_node->has_attr('xml:base');
- if ($has_href && $has_rel && $link->get_attr('rel') != 'self' && $link->get_attr('rel') != 'license')
+ if ($has_href && $has_rel && $link->get_attr('rel') != 'self' && $link->get_attr('rel') != 'license' && $link->get_attr('rel') != 'hub')
{
$site_url = $link->get_attr('href');
From 04a8c2c1ad1c3b5ea644961275575e21e621540a Mon Sep 17 00:00:00 2001
From: Jonas Pfenniger <jonas@pfenniger.name>
Date: Thu, 3 Jun 2010 17:59:45 +0200
Subject: [PATCH] homebrew: new unsafe download stategy
Use with care, for hosting sites that use broken SSL certificates
(one provided)
---
Library/Homebrew/download_strategy.rb | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
@zimbatm
zimbatm / Preliminary report.md
Created June 28, 2010 21:41
A mongrel2 evening, investigating a bug

== In short ==

I only found how to reproduce the bug with more details. A patch is not provided.

Chromium on 1st request, only loads the page at the given url as expected.

On refresh, it will first issue a GET /favicon.ico request, which is forwarded to the nginx proxy. Then GET /tests/index.html is issued. Because the connection is kept-alive by nginx and because mongrel2 doesn't inspect the traffic (I guess), the GET /tests/index.html will be forwarded to nginx on the same channel, bypassing the mongrel2 routing.

== In long ==

@zimbatm
zimbatm / call-cc3.js
Created July 11, 2010 16:07
JavaScript (fake) continuations
var sys = require('sys');
SLICE = Array.prototype.slice,
STACK_EX = (function() {
try {
test();
} catch(ex) {
return ex.constructor;
}
throw "BUG";
@zimbatm
zimbatm / gist:487157
Created July 23, 2010 07:57
Temporary disable $stdout
/* Temporary disable $stdout
============================
This method works for Ruby and new sub-processes.
I have seen other techniques on the net which re-assign $stdout with another IO,
but then the sub-processes will still use the old stdout.
*/
@zimbatm
zimbatm / gist:566369
Created September 5, 2010 22:04
Wifi bridge
#!/bin/sh
#
# eth0-eth1 Bridge
#
###### Config
WIFI_SSID="your ssid"
WIFI_PASS="your pass"
From 314733bb26efdd0a9b6fcb9ea7c1a352bf34f902 Mon Sep 17 00:00:00 2001
From: Jonas Pfenniger <jonas@pfenniger.name>
Date: Fri, 1 Oct 2010 21:29:53 +0200
Subject: [PATCH 1/2] Add process.now()
To avoid making a syscall, process.now() re-uses the timestamp
of the current libev loop, which is provided by ev_now().
The date object of process.now() is cached until ev_now() changes for
performance reasons.
@zimbatm
zimbatm / ev-check.txt
Created October 4, 2010 21:37
ev_now tests
undefined
------
previous: undefined
current: Mon, 04 Oct 2010 21:32:26 GMT
diff: 0
------
previous: Mon, 04 Oct 2010 21:32:26 GMT
current: Mon, 04 Oct 2010 21:32:27 GMT
diff: 1
------
@zimbatm
zimbatm / 0001-NEW-process.loopTime.patch
Created October 5, 2010 08:25
process.loopTime and loopDate
From cdec69e42bdd698947102ec07a5705d5088d9a92 Mon Sep 17 00:00:00 2001
From: Jonas Pfenniger <jonas@stvs.ch>
Date: Tue, 5 Oct 2010 10:01:35 +0200
Subject: [PATCH 1/2] NEW: process.loopTime
This new variable contains the timestamp at the start of the grand loop.
On first iteration, it will hold the timestamp at boot time.
---
src/node.cc | 12 ++++++++++++