Skip to content

Instantly share code, notes, and snippets.

View nagapavan's full-sized avatar

Pavan Kunisetty nagapavan

  • Bangalore, India
View GitHub Profile
@nicerobot
nicerobot / .screenrc
Created December 7, 2011 12:59
.screenrc with "tabs" using hardstatus and caption options
# look and feel
caption always "%{= bb}%{+b w}%h %=%{=b rw} %l %{= db} ${USER}@%H %{= dg}%c"
hardstatus alwayslastline "%-Lw%{= BW}%50>%n%f* %t%{-}%+Lw%<"
# skip the startup message
startup_message off
# go to home dir
chdir
@joaopizani
joaopizani / .screenrc
Created May 17, 2012 11:55
A killer GNU Screen Config
# the following two lines give a two-line status, with the current window highlighted
hardstatus alwayslastline
hardstatus string '%{= kG}[%{G}%H%? %1`%?%{g}][%= %{= kw}%-w%{+b yk} %n*%t%?(%u)%? %{-}%+w %=%{g}][%{B}%m/%d %{W}%C%A%{g}]'
# huge scrollback buffer
defscrollback 5000
# no welcome message
startup_message off
@ChimeraCoder
ChimeraCoder / gist:3152820
Created July 20, 2012 19:45
npm (node.js) equivalent of Python's pip freeze?
#Please tell me there is a better way to do this
#(And by 'a better way', I don't mean incorporating the cut within the awk script)
npm ls | grep -E "^(├|└)─" | cut -d" " -f2 | awk '{FS = "@"; print "\""$1"\"", ":", "\""$2"\""}'
@evandrix
evandrix / README.md
Created September 11, 2012 00:06
Headless web browsers

Here are a list of headless browsers that I know about:

  • [HtmlUnit][1] - Java. Custom browser engine. JavaScript support/DOM emulated. Open source.
  • [Ghost][2] - Python only. WebKit-based. Full JavaScript support. Open source.
  • [Twill][3] - Python/command line. Custom browser engine. No JavaScript. Open source.
  • [PhantomJS][4] - Command line/all platforms. WebKit-based. Full JavaScript support. Open source.
  • [Awesomium][5] - C++/.Net/all platforms. Chromium-based. Full JavaScript support. Commercial/free.
  • [SimpleBrowser][6] - .Net 4/C#. Custom browser engine. No JavaScript support. Open source.
  • [ZombieJS][7] - Node.js. Custom browser engine. JavaScript support/emulated DOM. Open source.
  • [EnvJS][8] - JavaScript via Java/Rhino. Custom browser engine. JavaScript support/emulated DOM. Open source.
@egaumer
egaumer / DSL Examples
Last active June 26, 2019 20:21
Some example queries using elastic.js
# simple match all query with term facet
ejs.Request()
.indices("myindex")
.types("mytype")
.query(ejs.MatchAllQuery())
.facet(
ejs.TermsFacet('url')
.field('url')
.size(20))
@millermedeiros
millermedeiros / example.js
Last active September 10, 2022 03:06
execute multiple shell commands in series on node.js
// USAGE ------
// ============
var shell = require('./shellHelper');
// execute a single shell command
shell.exec('npm test --coverage', function(err){
console.log('executed test');
}});

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11

Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html

When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (pure_flask.py)

@kethinov
kethinov / walksync.js
Created September 22, 2013 09:04
List all files in a directory in Node.js recursively in a synchronous fashion
// List all files in a directory in Node.js recursively in a synchronous fashion
var walkSync = function(dir, filelist) {
var fs = fs || require('fs'),
files = fs.readdirSync(dir);
filelist = filelist || [];
files.forEach(function(file) {
if (fs.statSync(dir + file).isDirectory()) {
filelist = walkSync(dir + file + '/', filelist);
}
else {
@baojie
baojie / flask-vs-tornado
Created December 3, 2013 23:42
flask vs tornado benchmark on basic routing and template rendering
Flask, Python 2.7, Single core 271.97 [#/sec] (mean)
Flask, Pypy, Single core 547.11
Flask+Gunicorn, Python, 8Core 1363.06
Flask+Gunicorn, Pypy, 8Core 2701.90
Flask+Gunicorn+Tornado, Python, 8Core 1403.88
Flask+Gunicorn+Tornado, Pypy, 8Core 2582.12
Tornado, Python, Single core 839.65
Tornado, Async, Python, Single core 801.19
Tornado, Pypy, Single core 1841.41
Tornado, Async, Pypy, Single core 1734.37
@adamrneary
adamrneary / gulpfile.js
Last active April 14, 2018 13:28
Sample gulpfile for pushing functions to Lambda
var gulp = require('gulp');
var gutil = require('gulp-util');
var del = require('del');
var rename = require('gulp-rename');
var install = require('gulp-install');
var zip = require('gulp-zip');
var AWS = require('aws-sdk');
var fs = require('fs');
var runSequence = require('run-sequence');