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
write some test code |
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 json | |
from bottle import route, run, request | |
def params_check(): | |
def decorator(func): | |
argnames=func.func_code.co_varnames[:func.func_code.co_argcount] | |
defnames = argnames[ (len(argnames)-len( func.func_defaults )):] | |
def wrapper(*args, **kwargs): | |
for argname in argnames: | |
if argname in request.GET: |
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 <string.h> | |
static const char *major_tune_strs[2][12]= | |
{ | |
{"C", "Db", "D", "Eb", "E", "F", "F#", "G", "Ab", "A", "Bb", "B"}, | |
{"C", "C#", "D", "D#", "E", "F", "Gb", "G", "G#", "A", "A#", "B"}, | |
}; | |
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
(function (A, w) { | |
function ma() { | |
if (!c.isReady) { | |
try { | |
s.documentElement.doScroll("left") | |
} catch (a) { | |
setTimeout(ma, 1); | |
return | |
} | |
c.ready() |
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
/* 1: listener as Activity's internal object. */ | |
public class ContactsInserter extends Activity { | |
View.OnClickListener onInsert=new View.OnClickListener() { | |
public void onClick(View v) { | |
} | |
}; | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); |
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
#!/usr/bin/node | |
var jade = require('jade'); | |
var fs = require('fs'); | |
var path = require('path'); | |
var compile = function (str) { | |
options ={ client: true, compileDebug: false}; | |
var fn = jade.compile(str, options); | |
return fn.toString(); | |
} |
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
#global process require exports | |
sys = require 'util' | |
pcap = require 'pcap' | |
require 'buffertools' | |
if process.argv.length > 4 | |
sys.error "usage: simple_capture interface filter" | |
sys.error "Examples: " | |
sys.error ' simple_capture "" "tcp port 80"' | |
sys.error ' simple_capture eth1 ""' |
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
#usage: | |
#coffee timer.coffee | |
#input the following command | |
# s1000 | |
# e | |
# s100 | |
# e | |
# s2000 | |
# e |
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
#simple key value | |
ip: 192.168.12.33 | |
dmac: '55:33:44:22:11' | |
#array | |
hwifs: | |
- eth0 | |
- eth1 | |
- en2 |
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
util = require 'util' | |
fs= require 'fs' | |
yaml = require 'js-yaml' | |
# pass the string | |
fs.readFile 'example.yml', 'utf8', (err, data) -> | |
if err | |
console.log 'something wrong', err | |
return | |
try |
OlderNewer