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
""" | |
Example of setting up CORS with Bottle.py. | |
""" | |
from bottle import Bottle, request, response, run | |
app = Bottle() | |
@app.hook('after_request') | |
def enable_cors(): | |
""" |
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 argv = process.argv.slice(2); | |
var fs = require('fs'); | |
var path = require('path'); | |
var hem = new (require('hem'))(); | |
var ect = require('ect'); | |
// ect compiler | |
hem.compilers.ect = function(path) { | |
var renderer, content, template; | |
renderer = ect({}); |
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
# add hem and nunjucks to your package.json | |
{ | |
... | |
"dependencies": { | |
... | |
"hem": "~0.3.6", | |
"nunjucks": "~1.0.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
/* jshint node: true */ | |
var argv = process.argv.slice(2); | |
var fs = require('fs'); | |
var hem = new (require('hem'))(); | |
hem.compilers.html = function(path) { | |
var nunjucks = require('nunjucks'), | |
name = path.split('app/')[1], | |
opts = { | |
name: name, |
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
module.exports = (function() { | |
var App, | |
Spine = require('spine'), | |
$ = Spine.$; | |
// extend Spine | |
require('spine/lib/local'); | |
require('spine/lib/ajax'); | |
require('spine/lib/route'); | |
require('spine/lib/manager'); |
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
// assertions/compareScreenshot.js | |
var resemble = require('resemble'), | |
fs = require('fs'); | |
exports.assertion = function(filename, expected) { | |
var screenshotPath = 'test/screenshots/', | |
baselinePath = screenshotPath + 'baseline/' + filename, | |
resultPath = screenshotPath + 'results/' + filename, | |
diffPath = screenshotPath + 'diffs/' + filename; |
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
// Created by Derrick Cohodas (dav-) | |
// Based on the Python example by StackExchange user wwnick from http://gis.stackexchange.com/a/415/41129 | |
// Requires the Mathjs library - http://mathjs.org/ | |
var math = require('mathjs') | |
/** | |
* Represents a coordinate with a distance | |
* @param {Number} lat Latitude |
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> | |
<head> | |
<script> | |
customElements.define("star-wars-planets", class extends HTMLElement { | |
constructor() { | |
super(); | |
this.attachShadow({ mode: "open" }); | |
} | |
static get observedAttributes() { return ["loading", "planets"]; } |
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
#!/bin/sh | |
FLUTTER_BRANCH=`grep channel: .metadata | sed 's/ channel: //g'` | |
FLUTTER_REVISION=`grep revision: .metadata | sed 's/ revision: //g'` | |
git clone https://github.com/flutter/flutter.git | |
cd flutter | |
git checkout $FLUTTER_BRANCH | |
git pull origin $FLUTTER_BRANCH | |
git checkout $FLUTTER_REVISION | |
cd .. |
OlderNewer