This file contains hidden or 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
// thanks to https://gitter.im/mikolalysenko/regl | |
import createRegl from 'regl' | |
const mat4 = require('gl-mat4') | |
const cubePosition = [ | |
[-0.5, +0.5, +0.5], [+0.5, +0.5, +0.5], [+0.5, -0.5, +0.5], [-0.5, -0.5, +0.5], // positive z face. | |
[+0.5, +0.5, +0.5], [+0.5, +0.5, -0.5], [+0.5, -0.5, -0.5], [+0.5, -0.5, +0.5], // positive x face | |
[+0.5, +0.5, -0.5], [-0.5, +0.5, -0.5], [-0.5, -0.5, -0.5], [+0.5, -0.5, -0.5], // negative z face |
This file contains hidden or 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> | |
<meta charset="utf-8"> | |
<svg width="960" height="500"></svg> | |
<div id="gui"></div> | |
<script src="https://d3js.org/d3.v4.min.js"></script> | |
<script> | |
var svg = d3.select("svg"), | |
width = +svg.attr("width"), | |
height = +svg.attr("height"), | |
transform = d3.zoomIdentity; |
This file contains hidden or 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
{ | |
"name": "test coverage example", | |
... | |
"scripts": { | |
"test": "NODE_ENV=test mocha --colors build/spec --timeout 5000", | |
"coverage": "NODE_ENV=test ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha -R spec" | |
}, | |
"dependencies": { |
This file contains hidden or 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
// from https://github.com/dbertella/cheap-flights/blob/master/proxy/server.js | |
var http = require('http'), | |
httpProxy = require('http-proxy'); | |
var port = 3000; | |
var proxy = httpProxy.createProxyServer(); | |
http.createServer(function(req, res) { |
This file contains hidden or 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
/* | |
# random client_id and random client_secret | |
curl --form client_id='3MVG9Nc1qcT7BbZ1AmkC7gLt_RtFNrY9XCsATBeio3ijPozoP.4qTcKKDGOT5V2V78I.4Ne1RXRTEJjqoZzNC' \ | |
--form client_secret='6092197970455970980' \ | |
--form grant_type=password \ | |
--form username='[email protected]'\ | |
--form password='password' \ | |
https://site.com/services/oauth2/token | |
This file contains hidden or 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 lang="en"> | |
<head> | |
<title>three.js webgl - interactive cubes</title> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"> | |
<style> | |
body { | |
font-family: Monospace; |
This file contains hidden or 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
<?php | |
/* | |
Plugin Name: qTranslate META | |
Plugin URI: http://johnjcamilleri.com/2010/01/qtranslate-and-multilingual-meta-tags/ | |
Description: Multilingual support for META tags. Requires qTranslate. | |
Version: 1.0.2 | |
Author: John J. Camilleri | |
Author URI: http://johnjcamilleri.com | |
*/ |
This file contains hidden or 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
// to simulate some recordered arduino output that print a value each 100ms on a serial terminal | |
// thanks to https://github.com/mcollina and https://gist.github.com/walling/ | |
'use strict'; | |
var fs = require('fs'), | |
split2 = require('split2'), | |
through = require('through2') | |
var filename = process.argv[2]; |
This file contains hidden or 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
float val = (exp(sin(millis()/2000.0*PI)) - 0.36787944)*108.0; |
This file contains hidden or 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
from PIL import Image | |
from math import pow | |
import colorsys | |
import urllib, cStringIO | |
T = 500 | |
URL = 'http://iot.merfobrienzi.it/img.jpg' | |
basewidth = 80 | |
# http://blog.soulwire.co.uk/code/actionscript-3/colourutils-bitmapdata-extract-colour-palette |