Skip to content

Instantly share code, notes, and snippets.

@hlobil
hlobil / server.js
Created April 21, 2018 15:24 — forked from OrKoN/server.js
Simple server with synchronization of request processing
/**
* WARNING: don't use the code in production, it only works for a single process instance and does not work in cluster mode.
*/
const express = require('express');
const app = express();
let nextRequestId = 1; // request counter
let nextPaymentId = 1; // payment counter
@hlobil
hlobil / introrx.md
Created November 16, 2015 06:09 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
# coding=UTF-8
from __future__ import division
import nltk
import re
import requests
# Add your freebase key here
# If you don't have one, register at https://code.google.com/apis/console
FREEBASE_KEY = ""
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
docker run -rm -t -i -v $(dirname $SSH_AUTH_SOCK) -e SSH_AUTH_SOCK=$SSH_AUTH_SOCK ubuntu /bin/bash
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
#!/bin/sh
# Usage:
# curl https://raw.github.com/gist/3791075 | sh -s 0.8.10
# This script will simply install/update node.js to the version you specify.
# It will be installed/updated to $HOME/local/node
NODEJS=v$1
@hlobil
hlobil / README.md
Created October 17, 2012 01:17 — forked from TooTallNate/README.md
Forward port 80 traffic from 127.0.0.1 to port 3000 at bootup on OS X

Copy this file to: /Library/LaunchDaemons/fwd-80-to-3000.plist and then reboot:

$ sudo -s
$ curl https://raw.github.com/gist/3372589/fwd-80-to-3000.plist > /Library/LaunchDaemons/fwd-80-to-3000.plist
$ reboot
@hlobil
hlobil / Folder Preferences
Created October 16, 2012 14:29 — forked from chrisyour/Folder Preferences
Show hidden files and hidden folders (except .git) in your TextMate project drawer
# Want to show hidden files and folders in your TextMate project drawer? Simple, just modify the file and folder patterns in TextMate's preferences.
# Instructions:
# Go to TextMate > Preferences...
# Click Advanced
# Select Folder References
# Replace the following:
# File Pattern
@hlobil
hlobil / load-google-maps.js
Created January 25, 2012 00:31 — forked from gbakernet/load-google-maps.js
Load Google Maps API using jQuery Deferred.
/*!
* JavaScript - loadGoogleMaps( version, apiKey, language )
*
* - Load Google Maps API using jQuery Deferred.
* Useful if you want to only load the Google Maps API on-demand.
* - Requires jQuery 1.5
*
* Copyright (c) 2011 Glenn Baker
* Dual licensed under the MIT and GPL licenses.
*/