Skip to content

Instantly share code, notes, and snippets.

@shikhalev
shikhalev / i2p-pac.js
Created September 18, 2013 17:00
proxy.pac for i2p
function FindProxyForURL(url, host) {
if (dnsDomainIs(host, ".i2p")) {
return "PROXY 127.0.0.1:4444";
} else {
return "DIRECT";
}
}
@shikhalev
shikhalev / dzyn.js
Last active December 22, 2015 02:49
Немного дзынь-буддизму
var Tetrao = {
BLOCKS : [
'p', 'blockquote', 'div', 'address'
],
LINE_WIDTH : 80,
normalize : function (s) {
s = s.replace(new RegExp(' ', 'gm'), ' ');
@shikhalev
shikhalev / deco.rb
Created August 18, 2013 01:58
Samples for «decorators»
# encoding: utf-8
class Module
def decorator name, &wrapper
define_singleton_method name do |*names, **opts|
if names.length != 0
@ignore_wrap = true
names.each do |nm|
define_method nm, &wrapper.call(instance_method(nm), **opts)
body {
position : absolute;
top : 0px;
bottom : 0px;
left : 0px;
right : 0px;
padding : 0px;
margin : 0px;
}