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
| # RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com | |
| # defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below) | |
| module Player | |
| describe MovieList, "with optional description" do | |
| it "is pending example, so that you can write ones quickly" | |
| it "is already working example that we want to suspend from failing temporarily" do | |
| pending("working on another feature that temporarily breaks this one") |
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
| ;; emacs configuration | |
| (push "/usr/local/bin" exec-path) | |
| (add-to-list 'load-path "~/.emacs.d") | |
| (setq make-backup-files nil) | |
| (setq auto-save-default nil) | |
| (setq-default tab-width 2) | |
| (setq-default indent-tabs-mode nil) | |
| (setq inhibit-startup-message 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
| events: | |
| "change input": "fieldChanged", | |
| "change select": "selectionChanged", | |
| selectionChanged: (event) -> | |
| field = $ event.currentTarget | |
| value = $("option:selected", field).val() | |
| data = {} | |
| data[field.attr 'id'] = value |
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
| events: { | |
| "change input": "fieldChanged", | |
| "change select": "selectionChanged", | |
| }, | |
| selectionChanged: function(e){ | |
| var field = $(e.currentTarget); | |
| var value = $("option:selected", field).val(); | |
| var data = {}; | |
| data[field.attr('id')] = value; |
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 ...` |
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
| 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
| # -*- 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
| 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
| //JavaScript | |
| function _A(num){ | |
| var o = {}; | |
| o.a = num; | |
| o.square = function(){ | |
| return o.a * o.a; | |
| }; | |
| return o; |