Skip to content

Instantly share code, notes, and snippets.

View hellysmile's full-sized avatar
🦆
working hard!

Victor Kovtun hellysmile

🦆
working hard!
View GitHub Profile
if((e.which == 2) && (e.target.tagName.toLowerCase() == 'a' || $(e.target).parent()[0].nodeName.toLowerCase() == 'a')) {
var bIE=$.browser.msie,w=window,$o=$(e.target),oe=$o.data('events'),b=true,f=function(){};
if(typeof oe == 'object' && oe['click']) {
f=function() {
$o.trigger('click');
}
}
else {
b=(typeof $o[0].href == 'string' && ($o[0].target == undefined || $o[0].target == '' || $o[0].target == '_self'));
if( b ) {
@hellysmile
hellysmile / hstore.py
Created August 8, 2012 05:08 — forked from darjeeling/hstore.py
PostgreSQL hstore + SQLAlchemy
""":mod:`hstore` --- Using PostgreSQL hstore with SQLAlchemy
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. note::
I released it under Public Domain. Feel free to use!
It provides :class:`Hstore` type which makes you to store Python
dictionaries into hstore columns in PostgreSQL. For example::

A Backbone.js demo app (Sinatra Backend)

Oct 16 2010

Updates

  • 04/10/2011 - Updated application.js and application.rb thanks to @rebo's comments

In this article, I will walk through some simple steps to get a [demo app][2] up and running with [Backbone.js][3] and [Sinatra][4] on [Heroku][5].

@hellysmile
hellysmile / README.markdown
Created September 26, 2012 11:21 — forked from jrust/README.markdown
Bootstrap's Typeahead plugin extended (AJAX functionality, comma-separated values, autowidth, and autoselect)

This is a fork of a fork of Bootstrap Typeahead that adds minimal but powerful extensions.

  • Ability to disable autoselect of first matched element.
  • Ability to automatically set the width of the dropdown to that of the text input.
  • Ability to fetch source element via AJAX
  • Ability to have a comma separated list of tags.

For the proper source, and other examples, please see the original gist.

Example showing off all the above features

@hellysmile
hellysmile / haproxy.cfg
Created November 30, 2012 02:23 — forked from lackac/haproxy.cfg
HAProxy configuration with Websocket support
global
maxconn 4096 # Total Max Connections. This is dependent on ulimit
nbproc 2
log 127.0.0.1 local1 notice
defaults
mode http
log global
frontend all 0.0.0.0:80
@hellysmile
hellysmile / X-Forwarded-For stunnel 4.54 patch
Created December 1, 2012 06:29
X-Forwarded-For stunnel 4.54 patch
diff -crB stunnel-4.54/src/client.c stunnel-4.54-patched/src/client.c
*** stunnel-4.54/src/client.c 2012-10-09 22:36:36.000000000 +0200
--- stunnel-4.54-patched/src/client.c 2012-10-16 16:49:07.755373327 +0200
***************
*** 48,53 ****
--- 48,55 ----
#define SHUT_RDWR 2
#endif
+ #define IPLEN 40
@hellysmile
hellysmile / stunnel-4.54-xforwarded-for.diff
Created December 1, 2012 06:36 — forked from rraptorr/stunnel-4.54-xforwarded-for.diff
X-Forwarded-For stunnel 4.54 patch
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index b0204d6..7f46be0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -739,6 +739,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
@hellysmile
hellysmile / stunnel-4.53-xforwarded-for.diff
Created December 1, 2012 11:25 — forked from rraptorr/stunnel-4.53-xforwarded-for.diff
X-Forwarded-For stunnel 4.53 patch
diff --git a/doc/stunnel.8 b/doc/stunnel.8
index 589d968..f56f5c0 100644
--- a/doc/stunnel.8
+++ b/doc/stunnel.8
@@ -693,6 +693,10 @@ This options has been renamed to \fInone\fR.
.RE
.RS 4
.RE
+.IP "\fBxforwardedfor\fR = yes | no" 4
+.IX Item "xforwardedfor = yes | no"
yum install rubygems ruby-devel
yum groupinstall 'Development Tools'
gem install fpm
wget http://nginx.org/download/nginx-1.2.6.tar.gz
tar xvf nginx-1.2.6.tar.gz
cd nginx-1.2.6
./configure \
--user=nginx \
--group=nginx \
# -*- coding: utf-8 -*-
'''
Created on 2012-09-24
@author: Sergey <[email protected]>
How to test:
$ head -c 100M /dev/urandom > static_file.bin
$ python