Skip to content

Instantly share code, notes, and snippets.

View pkrumins's full-sized avatar

Peter Krumins pkrumins

View GitHub Profile
<?php
$browserlingTunnelPort = 59374;
$browserlingTunnelUrl = "http://tunnel.browserling.com:" . $browserlingTunnelPort . "/WordPress/TestingWp/";
if ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') {
define('WP_SITEURL', $browserlingTunnelUrl);
define('WP_HOME', $browserlingTunnelUrl);
update_option('siteurl', $browserlingTunnelUrl);
[daemons]
; enable SSL support by uncommenting the following line and supply the PEM's below.
; the default ssl port CouchDB listens on is 6984
; httpsd = {couch_httpd, start_link, [https]}
compaction_daemon={couch_compaction_daemon, start_link, []}
[compaction_daemon]
; The delay, in seconds, between each check for which database and view indexes
; need to be compacted.
check_interval = 300
iptables.list('Tunnels', function (rules) {
var ports = {};
rules.forEach(function (rule) {
if (rule.parsed.target == 'REJECT') return;
// extract tcp destination ports
var match = rule.raw.match(/tcp dpt:(\d+)/);
if (match) {
ports[parseInt(match[1])] = 1;
use warnings;
use strict;
use Text::CSV;
use constant {
ID => 0,
TYPE => 1,
SOURCE => 2,
AMOUNT => 3,
unsigned char *
rgba_to_rgb(unsigned char *rgba, int rgba_size)
{
int rgb_size = rgba_size/4*3;
unsigned char *rgb = malloc(sizeof(unsigned char)*rgb_size);
if (!rgb) return NULL;
int i, j;
for (i=0,j=0;i<rgba_size;i+=4,j+=3) {
rgb[j] = *(rgba+i);
rgb[j+1] = *(rgba+i+1);
node> o = { foo : 'bar' }
{ foo: 'bar' }
node> Object.defineProperty(o, 'moo', { value : 'cows', enumerable: false })
{ foo: 'bar' }
node> Object.keys(o)
[ 'foo' ]
node> o.moo
'cows'
node> Object.getOwnPropertyDescriptor(o, 'moo')
#!/bin/bash
#
trap 'echo; echo Aborting; exit 1' 2
for module in node-{video,png,jpeg,base64}
do
(
cd $module
rm -rf build/
// annoyingly many browsers don't have these:
if (!Object.keys) Object.keys = function (obj) {
var keys = [];
for (var key in obj) {
if (obj.hasOwnProperty(key)) {
keys.push(key);
}
}
return keys;
};
Hi Dionysios.
Thanks for the questions. My answers appear after each of the questions.
On Thu, Jul 22, 2010 at 10:55 AM, Dionysios G. Synodinos <synodinos@infoq.com> wrote:
Hi Peter,
My name is Dionysios Synodinos, I'm an editor for InfoQ and since we're doing an article on Node.js, we'd love to have your feedback.
#include <cstdlib>
#include <node.h>
#include <node_buffer.h>
using namespace v8;
using namespace node;
class RetBuf : public ObjectWrap {
public:
RetBuf() {}