Skip to content

Instantly share code, notes, and snippets.

View Sannis's full-sized avatar
🎯
Focusing

Oleg Efimov Sannis

🎯
Focusing
View GitHub Profile
@Sannis
Sannis / json-protocol.js
Created December 7, 2011 09:24 — forked from joekim/json-protocol.js
A simple carriage-return, line-feed delimited JSON protocol.
/*
A simple carriage-return, line-feed delimited JSON protocol.
Receiving Usage:
protocol = require('./json-protocol');
// parsing data
parser = protocol.StreamParser();
@Sannis
Sannis / LICENSE.txt
Created May 16, 2011 16:24 — forked from jed/LICENSE.txt
calculate # of ms/seconds/minutes/hours/days in the past
Copyright (c) 2011 Jed Schmidt, http://jed.is
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
// Copyright 2009 Ryan Dahl <ry@tinyclouds.org>
#include <v8.h>
#include <node.h>
#include <node_os.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
@Sannis
Sannis / AK-LABSharpen.scm
Created February 24, 2011 00:32
This script does LAB sharpening in GIMP using the unsharp mask.
;
; LAB Sharpen, v. 1.0
;
; Adam Kemp (gimp@adamkemp.com)
; (C) 2009
;
; This script does LAB sharpening in GIMP using the unsharp mask. The steps it automates are:
; 1. Decompose the image into LAB
; 2. Run the unsharp mask filter on the Luminance (L) layer using the supplied settings.
; 3. Recompose the image from the LAB image
From d4c7910b800fb5d521b9b870ee396a858e1d01b5 Mon Sep 17 00:00:00 2001
From: Oleg Efimov <efimovov@gmail.com>
Date: Wed, 2 Feb 2011 16:19:48 +0300
Subject: [PATCH] Fix wrong gmt_delta calculation in datetime casting, closes #72
---
src/mysql_bindings_result.cc | 20 ++++++++++++++++----
tests/complex/test-datatypes-cast.js | 32 ++++++++++++++++++++++++--------
2 files changed, 40 insertions(+), 12 deletions(-)
// Behavior explanation: http://dev.mysql.com/doc/refman/5.1/en/auto-reconnect.html
// Set MYSQL_OPT_RECONNECT
var conn = mysql_libmysqlclient.createConnectionSync();
conn.initSync();
conn.setOptionSync(conn.MYSQL_OPT_RECONNECT, 1);
conn.realConnectSync(cfg.host, cfg.user, cfg.password);
efimovov@efimovov-pc:~/tmp> cat ./this_func_anon.js
setTimeout(function () {
throw new Error();
}, 10);
efimovov@efimovov-pc:~/tmp> cat ./this_func_named.js
setTimeout(function blaBla() {
throw new Error();
}, 10);
efimovov@efimovov-pc:~/tmp> node this_func_anon.js
var util = require('util')
function hook_stdout(callback) {
var old_write = process.stdout.write
process.stdout.write = (function(write) {
return function(string, encoding, fd) {
write.apply(process.stdout, arguments)
callback(string, encoding, fd)
}
@Sannis
Sannis / GJSLint-all-tests-only-3-long-lines-left-in-test-url.patch
Created December 6, 2010 00:50
Node.js patch: GJSLint-all-tests-only-3-long-lines-left-in-test-url.patch
From 093dfaf801a10905ba27df8cf3aa17b36ea5149a Mon Sep 17 00:00:00 2001
From: Oleg Efimov <efimovov@gmail.com>
Date: Mon, 6 Dec 2010 01:33:52 +0300
Subject: [PATCH] GJSLint all tests, only 3 long lines left in test-url.js
test/simple/test-url.js:31:(0110) Line too long (82 characters).
test/simple/test-url.js:39:(0110) Line too long (85 characters).
test/simple/test-url.js:40:(0110) Line too long (92 characters).
---
test/common.js | 5 +-
@Sannis
Sannis / GJSLint-all-simple-tests-exclude-http-url-path.patch
Created December 6, 2010 00:49
Node.js patch: GJSLint-all-simple-tests-exclude-http-url-path.patch
From 0665f0271e71270dc23ec5231b245adfe709a49f Mon Sep 17 00:00:00 2001
From: Oleg Efimov <efimovov@gmail.com>
Date: Sun, 5 Dec 2010 22:15:30 +0300
Subject: [PATCH] GJSLint all simple tests exclude http-*, url, path
---
test/common.js | 22 ++--
test/simple/path.js | 4 +-
test/simple/test-assert.js | 113 ++++++------
test/simple/test-buffer.js | 190 ++++++++++++--------