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 gulp = require("gulp"); | |
var debug = require("gulp-debug"); | |
var request = require("request"); | |
var source = require("vinyl-source-stream"); | |
var streamify = require("gulp-streamify"); | |
var prepend = require("gulp-header"); | |
var uglify = require("gulp-uglify"); |
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 (value, config) { | |
var matchbox = /{([^a-z]?)([a-z_]+)([^a-z|]?)(\|[^}]+)?}/g; | |
var translator = function (match, prefix, value, suffix, defaultValue) { | |
if (config.hasOwnProperty(value)) { | |
return prefix + config[value] + suffix; | |
} | |
if (defaultValue) { | |
return defaultValue.replace('|', ''); | |
} |
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 glob = require("glob"); | |
var fs = require("fs"); | |
var optimizers = { | |
"clean-css": function (content) { | |
var optimizer = require("clean-css"); | |
return new optimizer({}).minify(content); | |
}, | |
"csso": function (content) { |
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 (scope) { | |
var privateStaticProperty = null; | |
var privateStaticMethod = function () { | |
console.log("private hello"); | |
}; | |
var PublicClass = function () { | |
var self = this; |
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 re | |
import requests | |
from prettytable import PrettyTable | |
from pyquery import PyQuery as pq | |
url = "http://www.apple.com/" | |
p = re.compile(r'\W+') | |
r = requests.get(url) | |
document = pq(r.text) |
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 getPixel (x, y) { | |
var pixels = Picture.getPixel(x, y), | |
red = pixels[0], | |
green = pixels[1], | |
blue = pixels[2]; | |
if (red > 128) { | |
red /= 2; | |
red += Math.random() * 0x33; | |
} else { |
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 appendToOnload (callback) { | |
if (typeof window.onload !== "function") { | |
window.onload = callback; | |
return; | |
} | |
var formerCallback = window.onload; | |
window.onload = function () { | |
formerCallback(); |
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> | |
<meta charset="utf-8"> | |
<title>Namen</title> | |
<style> | |
body { | |
background: #8f1; |
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 foobar = {}; | |
var name1 = "test-foo-bar"; | |
var name2 = "test-bar-foo"; | |
var addObject = function(parts, object, value) { | |
if (parts.length <= 0) | |
return value; | |
if (!object[parts[0]]) | |
object[parts[0]] = {}; | |
object[parts[0]] = addObject(parts.slice(1), object[parts[0]], value); | |
return object; |
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 urllib.request, urllib.parse, urllib.error | |
import math | |
# change os_url & file_base_url if you aren't on a Windows PC | |
server_url_base = "http://commondatastorage.googleapis.com/chromium-browser-snapshots/" | |
os_url = "Win/" # "Mac/" | |
file_base_url = "/chrome-win32.zip" # "/chrome-mac.zip" | |
latest_url = server_url_base + os_url + "LAST_CHANGE" |