This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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[':'], { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (req.method === 'OPTIONS') { | |
console.log('!OPTIONS'); | |
var headers = {}; | |
// IE8 does not allow domains to be specified, just the * | |
// headers["Access-Control-Allow-Origin"] = req.headers.origin; | |
headers["Access-Control-Allow-Origin"] = "*"; | |
headers["Access-Control-Allow-Methods"] = "POST, GET, PUT, DELETE, OPTIONS"; | |
headers["Access-Control-Allow-Credentials"] = false; | |
headers["Access-Control-Max-Age"] = '86400'; // 24 hours | |
headers["Access-Control-Allow-Headers"] = "X-Requested-With, X-HTTP-Method-Override, Content-Type, Accept"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//JavaScript | |
function _A(num){ | |
var o = {}; | |
o.a = num; | |
o.square = function(){ | |
return o.a * o.a; | |
}; | |
return o; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class FuckyView(object): | |
def __init__(self, request): | |
self.request = request | |
@view_config(context="starter.resources.Bar") | |
def fucky(request): | |
return Response('fucky view') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# получить twitter можно командой `pip install twitter` | |
import sys;reload(sys);sys.setdefaultencoding('utf-8') | |
import twitter | |
import time | |
import commands, itertools | |
consumer_key = ... | |
consumer_secret = ... | |
access_key = ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:var%20b=document.body;var%20GR________bookmarklet_domain='http://www.google.com';if(b&&!document.xmlVersion){void(z=document.createElement('script'));void(z.src='http://www.google.com/reader/ui/subscribe-bookmarklet.js');void(b.appendChild(z));}else{location='http://www.google.com/reader/view/feed/'+encodeURIComponent(location.href)} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; use ido for minibuffer completion | |
(require 'ido) | |
(ido-mode t) | |
(setq ido-save-directory-list-file "~/.emacs.d/.ido.last") | |
(setq ido-enable-flex-matching t) | |
(setq ido-use-filename-at-point 'guess) | |
(setq ido-show-dot-for-dired t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#~/.ackrc | |
--type-add | |
html=.erb,.haml,.jade | |
--type-set | |
scripts=.js,.coffee | |
--type-set | |
styles=.css,.scss,.sass,.less | |
--ignore-dir=node_modules | |
--ignore-dir=vendor # you still can ack in vendor files - just `cd vendor && ack ...` |
OlderNewer