Ctrl - Shift - E- Split verticallyCtrl - Shift - O- Split horizontallyCtrl - Shift - P- Focus next viewCtrl - Shift - N- Focus previous viewCtrl - Shift - W- Close focused viewCtrl - Shift - Q- Exit terminatorCtrl - Shift - X- Enlarge active 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
| <!doctype html> | |
| <html ng-app="ctz"> | |
| <head> | |
| <title>CategoryTree</title> | |
| <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js"></script> | |
| <script> | |
| angular.module('treeApp', []); | |
| angular.module('treeApp').controller('treeCtrl', treeCtrl); | |
| treeCtrl.$inject = ['$scope', '$http']; |
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 pyelasticsearch as pyes | |
| import csv | |
| URL_ES = 'http://localhost:9200/' | |
| CSV_FILE = 'example.csv' | |
| INDEX = 'Index' | |
| TYPE = 'Type' | |
| ID_FIELD = 'id' | |
| f = open(CSV_FILE) |
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
| def snail(array): | |
| results = [] | |
| while len(array) > 0: | |
| # go right | |
| results += array[0] | |
| del array[0] | |
| if len(array) > 0: | |
| # go down | |
| for i in array: |
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
| array_diff = lambda y,x: [i for i in y if i not in x] |
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
| server { | |
| index index.html index.htm index.php; | |
| set $basepath "/var/www"; | |
| set $domain $host; | |
| if ($domain ~ "^(.[^.]*)\.dev$") { | |
| set $domain $1; | |
| set $rootpath "${domain}"; | |
| set $servername "${domain}.dev"; | |
| } |
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
| #Newbie programmer | |
| def factorial(x): | |
| if x == 0: | |
| return 1 | |
| else: | |
| return x * factorial(x - 1) | |
| print factorial(6) | |
| #First year programmer, studied Pascal |
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
| <?php | |
| class FileUpload | |
| { | |
| private $from; | |
| private $destination; | |
| public function __construct($file, $id, $destination = '/tmp', $validExtensions = array()) | |
| { | |
| if (!is_array($file) || empty($file['tmp_name']) || !$file['tmp_name']) { |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
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
| for (var i = 0; i < 1024 * 1024; i++) { | |
| process.nextTick(function () { Math.sqrt(i) } ) | |
| } |
OlderNewer