Skip to content

Instantly share code, notes, and snippets.

View e0ne's full-sized avatar
🏠
Working from home

Ivan Kolodyazhny e0ne

🏠
Working from home
View GitHub Profile
@e0ne
e0ne / menu.js
Created February 3, 2013 00:29
Set active class for menu link of the current page
$(document).ready(function(){
var desiredMenuItem = document.location.hash.replace("#", "") || 'home';
$(".nav a[rel=" + desiredMenuItem + "]").parent().addClass("active");
})s
/*
** Pascal Sebah : September 1999
**
** Subject:
**
** A very easy program to compute Pi with many digits.
** No optimisations, no tricks, just a basic program to learn how
** to compute in multiprecision.
**
** Formulae:
@e0ne
e0ne / simpleproxy.js
Created July 21, 2012 17:15
Simple proxy server on NodeJS
var http = require('http')
http.createServer(function(request, response){
var request_options = {
host: request.headers['host'],
port: 80,
path: request.url,
method: request.method
}
var proxy_request = http.request(request_options, function(proxy_response){