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
| git config --global alias.amend "commit --amend -C HEAD" |
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
| import heapq | |
| def merge(*queues): | |
| """Merge N sorted sequences.""" | |
| queues = map(iter, queues) | |
| # Build a heap containing the next item in each queue. | |
| ready = [] | |
| for queue in queues: | |
| heapq.heappush(ready, (next(queue), queue)) | |
| # Process until all items are consumed. |
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
| #include <cstdlib> | |
| #include <iostream> | |
| #include <map> | |
| #include <memory> | |
| #include <http.hpp> | |
| #include <zmq.hpp> | |
| // Peer identity, for use as a key type in `std::map`. |
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
| import re | |
| def parse_extension(x): | |
| """Extract the key and value (without quotes).""" | |
| m = re.match(r'\s*(\S+)\s*=\s*(?:"([^"]+)"|(\S+))', x) | |
| if not m: | |
| pass | |
| return m.group(1), m.group(2) or m.group(3) | |
| def parse_header(h): |
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
| (require 'buffer-move) | |
| (defun win-swap () | |
| "Swap windows using `buffer-move`." | |
| (interactive) | |
| (if (null (windmove-find-other-window 'right)) | |
| (buf-move-left) | |
| (buf-move-right))) |
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 recursive-grep (args file-pattern search-root) | |
| """Useful recursive-find function based on grep. | |
| Prompts for 3 inputs: | |
| - grep arguments, defaults to the current selection or | |
| the word at current position in buffer or \"-i \"; | |
| - file pattern, defaults to current buffer's file extension; | |
| - search root, defaults to folder containnig the current buffer's file. | |
| Use `find-grep-match` (C-x C-n) to goto result location.""" |
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
| git clone git://github.com/AndreLouisCaron/pcrexx.git | |
| cd pcrexx | |
| git submodule init | |
| git submodule update | |
| mkdir work | |
| cd work | |
| cmake .. | |
| cmake .. | |
| make |
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 -*- | |
| from pyramid.config import Configurator | |
| from pyramid.httpexceptions import HTTPPreconditionFailed | |
| from cornice.resource import resource, view | |
| from webtest import TestApp | |
| @resource(path='/hello') | |
| class Hello(object): | |
| def __init__(self, request): |
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 -*- | |
| from pyramid.config import Configurator | |
| from cornice.resource import resource, view | |
| from webtest import TestApp | |
| @resource(path='/hello') | |
| class Hello(object): | |
| def __init__(self, request): | |
| self.request = request |