Skip to content

Instantly share code, notes, and snippets.

@anwajler
anwajler / 0_reuse_code.js
Created December 23, 2013 18:09
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@anwajler
anwajler / readstream.js
Created May 22, 2011 15:47
Node.js ReadStream
var path = '/tmp/read-simple.txt';
var options = { flags: 'r',
encoding: 'utf-8',
mode: 0666,
bufferSize: 1024,
start: 0,
end: 100
};
var dataReceived = function(data) {
console.log(data);
@anwajler
anwajler / smartpay.pl.rb
Created May 8, 2011 11:50
Smartpay.pl handling
require 'net/http'
require 'net/https'
MESSAGES = {
# OK
"1001" => "kod zostal znaleziony i jest aktywny",
# INACTIVE
"2001" => "szukany kod nie zostal znaleziony",
"2002" => "kod zostal znaleziony, ale nie jest juz aktywny",
# ERROR