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
// switch case! | |
var add_level = {'5':1,'10':2,'12':3,'15':4}[12] || 0 | |
//>>3 | |
({'5':1,'10':2,'12':3,'15':4})[12] || 0 | |
//>> 3 | |
({'5':-1,'10':20.7e+5,'12':3,'15':"Right",'22':[4,1,16],'log':function() {console.log("that all right!")}})[12] || 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
# change files owner to current user | |
alias own='sudo chown -R $(id -u):$(id -g)' |
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 sendFile(option, cb) { | |
/* { | |
field: name, | |
url: '/path/to/upload', | |
file: FileObject | |
} */ | |
var field = option.field; | |
var xhr = new XMLHttpRequest(); | |
var fd = new FormData(); | |
var resp; |
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
/** | |
* requires node.js with ES6 support, or babel | |
*/ | |
'use strict'; | |
const vm = require('vm'); | |
const fs = require('fs'); | |
const __loggers__ = {}; | |
function log(tag) { |
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
exports.createHandler = function (method) { | |
return new Handler(method); | |
} | |
Handler = function(method) { | |
this.process = function(req, res) { | |
params = null; | |
return method.apply(this, [req, res, params]); | |
} | |
} |
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/env bash | |
# names of latest versions of each package | |
export NGINX_VERSION=1.9.12 | |
export VERSION_PCRE=pcre-8.38 | |
export VERSION_LIBRESSL=libressl-2.3.2 | |
export VERSION_NGINX=nginx-$NGINX_VERSION | |
#export NPS_VERSION=1.9.32.10 | |
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta | |
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
html, | |
body, | |
div, | |
span, | |
applet, | |
object, | |
iframe, | |
h1, | |
h2, | |
h3, |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="https://code.jquery.com/jquery-1.11.3.js"></script> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>JS Bin</title> | |
<style> | |
#container > img { | |
width: 200px; |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.9/angular.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.3.9/angular-route.min.js"></script> | |
<style> | |
a, a:hover { | |
text-decoration: none; | |
} | |
#content{ | |
border:2px solid #e5e5e5; | |
overflow: hidden; |
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(){ | |
YAML = { | |
valueOf: function(token) { | |
return eval('(' + token + ')') | |
}, | |
tokenize: function(str) { | |
return str.match(/(---|true|false|null|#(.*)|\[(.*?)\]|\{(.*?)\}|[\w\-]+:|-(.+)|\d+\.\d+|\d+|\n+)/g) | |
}, |
OlderNewer