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 Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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 ast | |
| def menu(*args, **kwargs): | |
| def inner(f): | |
| pass | |
| return inner | |
| a = ast.parse(''' | |
| @menu('xxx', parent='xxx') | |
| class Xxx(object): |
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 menu(name, parent_name): | |
| do_some_thing_with_params(name, parent_name) | |
| def inner_func(f): | |
| do_some_thing() | |
| return f() | |
| return inner_func |
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
| # -*- mode: ruby -*- | |
| # vi: set ft=ruby : | |
| git_user_name = `git config --get user.name`.strip | |
| git_user_email = `git config --get user.email`.strip | |
| Vagrant.configure(2) do |config| | |
| config.vm.box = "ubuntu/trusty64" | |
| config.vm.box_check_update = false |
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
| d = {'a': 1, 'b': 2} | |
| keys = d.keys() | |
| for k in keys: | |
| v = d[k] | |
| d['xxx'] = 'ooo' |
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
| // generated by asdl_pyston.py | |
| #include <algorithm> | |
| #include <cmath> | |
| #include <langinfo.h> | |
| #include <sstream> | |
| #include "llvm/Support/FileSystem.h" | |
| #include "llvm/Support/Path.h" | |
| #include "codegen/unwinding.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
| import os import sys | |
| # make stdout and stderr without buffer | |
| sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) | |
| sys.stderr = os.fdopen(sys.stderr.fileno(), 'w', 0) |
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 strict'; | |
| var async = require('async'); | |
| var let_it_bug = true; | |
| var ioFunc = function(cb) { | |
| if (! let_it_bug) { | |
| var result = 42; // do something to get the result | |
| cb(undefined, 42); |
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 p1 = new Promise(function(resolve, reject) { | |
| setTimeout(function() { | |
| resolve(1); | |
| }, 2); | |
| }); | |
| var p2 = new Promise(function(resolve, reject) { | |
| setTimeout(function() { | |
| reject(1); | |
| }, 1); |
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 assert = require("assert"); | |
| var activities = { | |
| "Aqua aerobics": 4, | |
| "Athletics, high jump, long jump, triple jump, javelin, pole vault": 6, | |
| "Athletics, shot, discus, hammer": 4, | |
| "Athletics, steeplechase, hurdles": 10, | |
| "Badminton, competitive": 7, | |
| "Badminton, social": 4.5, | |
| "Baseball": 5, |