This file contains 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
local inspect = require "inspect" | |
local web = require "web" | |
app = web.Application:new() | |
app:handle('GET', '^/?$', function(req, res) | |
res.print('this is index') | |
end) | |
app:handle('GET', '^/about/?$', function(req, res) |
This file contains 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 <stdio.h> | |
#include <stdlib.h> | |
struct Person { | |
char* name; | |
void (^say)(void); | |
}; | |
struct Person *PersonNew(char *name) { | |
struct Person *self = malloc(sizeof(struct Person)); |
This file contains 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, |
This file contains 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 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 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 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 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 marshal | |
import struct | |
import time | |
import imp | |
from opcode import opmap | |
def f(): return | |
code = type(f.__code__) # the code object type | |
code_list = ( |
This file contains 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 marshal | |
import struct | |
import time | |
import imp | |
from opcode import opmap | |
SEXPR = ('+', 1, | |
('-', 3, | |
('+', 1 , 1))) |
This file contains 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' |
OlderNewer