Skip to content

Instantly share code, notes, and snippets.

View ichernev's full-sized avatar

Iskren Ivov Chernev ichernev

  • Palo Alto, California, USA
View GitHub Profile
@ichernev
ichernev / ie8_greek.html
Last active December 26, 2015 12:29
Ie8 RegExp ignoreCase bug with greek letters
<!doctype html>
<html>
<head></head>
<body>
<pre></pre>
<script>
var names = [
'Μάρτιος',
'Μάιος',
'Ιούνιος',
@ichernev
ichernev / changelog.md
Created October 7, 2013 08:23
Changes in moment 2.3.0

What is new to moment 2.3.0 (relative to 2.2.1)

ATTENTION (may break code) isValid reworked

#1140, #913

Completely new model for computing whether a moment is valid or not. Also added parsing flags to allow checking specific issues during parsing.

.format() now returns Ivalid Date for invalid moments. Read #1140 for

@ichernev
ichernev / bar.tt.html
Created August 15, 2013 17:11
Tornado module Template doesn't work on v3.1.0
<h2>{{ custom }}</h2>
setxkbmap \
-layout 'us,bg' \
-variant ',phonetic' \
-option '' \
-option 'terminate:ctrl_alt_bksp' \
-option 'ctrl:nocaps' \
-option "grp:alt_shift_toggle"
@ichernev
ichernev / ghc-pkg.list
Created January 4, 2013 08:27
installed haskell packages
% ghc-pkg list
/usr/lib/ghc-7.6.1/package.conf.d
Cabal-1.16.0
array-0.4.0.1
base-4.6.0.0
bin-package-db-0.0.0.0
binary-0.5.1.1
bytestring-0.10.0.0
containers-0.5.0.0
deepseq-1.3.0.1
@ichernev
ichernev / conv.coffee
Created September 11, 2012 12:44
Convert \xFF encoded utf8 file to utf8 file
fs = require 'fs'
fileContent = fs.readFileSync process.argv[2], 'utf-8'
res = fileContent.replace /((\\x[0-9A-F][0-9A-F])+)|([\s\S])/g, ->
if arguments[3]?
new Buffer(arguments[3], 'utf-8').toString('hex')
else
arguments[1].replace(/\\x/g, '').toLowerCase()
@ichernev
ichernev / node.js
Created August 29, 2012 22:46
node vs ruby openssl
var crypto = require('crypto')
var rep = function(times, elem) {
var res = new Array(times);
for (var i = 0; i < times; ++i) {
res[i] = elem;
}
return res;
};
@ichernev
ichernev / momenen-test.log
Created August 28, 2012 08:17
moment create test failure
✖ create - six digit years
Assertion Message: parse BC 270,001
AssertionError: -270001 == -270000
at Object.assertWrapper [as equal] (/home/iskren/src/moment/node_modules/nodeunit/lib/types.js:83:39)
at Object.exports.create.six digit years (/home/iskren/src/moment/test/moment/create.js:320:14)
at Object.wrapTest (/home/iskren/src/moment/node_modules/nodeunit/lib/core.js:235:16)
at Object.wrapTest (/home/iskren/src/moment/node_modules/nodeunit/lib/core.js:235:16)
at wrapTest (/home/iskren/src/moment/node_modules/nodeunit/lib/core.js:235:16)
at Object.exports.runTest (/home/iskren/src/moment/node_modules/nodeunit/lib/core.js:69:9)
@ichernev
ichernev / inproc_dealer.c
Created August 8, 2012 21:51
inproc & dealer socket error
#include "zmq.h"
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int main(void)
{
void *context = zmq_init (1);
@ichernev
ichernev / lruqueue.js
Created August 5, 2012 22:15
Node.js zmq guide examples
// Least-recently used (LRU) queue device in Node.js
var startClientsAndWorkersNowait = true
, terminate = 'skip'; // 'immediately', 'later', 'skip'
var numberOfClients = 10
, numberOfWorkers = 3;
var zmq = require('zmq')
, frontend = zmq.socket('router')