Skip to content

Instantly share code, notes, and snippets.

View nilcolor's full-sized avatar
💫
API by day, IPA by night

Alexey Blinov nilcolor

💫
API by day, IPA by night
View GitHub Profile
@nilcolor
nilcolor / gist:812487
Created February 5, 2011 14:29
Node.js pristine server template
var http = require('http'),
url = require('url'),
qs = require('querystring');
var paths = {
'__default__': function (req, res) {
console.log('noop');
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end();
},
@nilcolor
nilcolor / gist:790443
Created January 21, 2011 21:18
Set Emacs default frame size
(defun set-frame-size-according-to-resolution ()
(interactive)
(if window-system
(progn
;; use 180 char wide window for largeish displays
;; and smaller 80 column windows for smaller displays
;; pick whatever numbers make sense for you
(if (> (x-display-pixel-width) 1280)
(add-to-list 'default-frame-alist (cons 'width 180))
(add-to-list 'default-frame-alist (cons 'width 80)))
(function($, window, document, undefined){
//handy log function
window.log = function(){
log.history = log.history || [];
log.history.push(arguments);
if(this.console)
console.log( Array.prototype.slice.call(arguments) );
};
$.extend($.expr[':'], {