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 spawn = require( "child_process" ).spawn; | |
var node; | |
gulp.task( "server", function() { | |
if ( node ) node.kill(); | |
node = spawn( "node", [ "app.js" ], { stdio: "inherit" } ); |
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
Show hidden characters
[ | |
{ "keys": ["alt+up"], "command": "swap_line_up" }, | |
{ "keys": ["alt+down"], "command": "swap_line_down" }, | |
{ "keys": ["ctrl+e"], "command": "encode_html_entities" } | |
] |
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
@mixin cover-background( $path ) { | |
background-image: url( "../../" + $path ); | |
@include background-size( cover ); | |
-ms-filter: "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + $path + "', sizingMethod='scale')"; | |
filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src="", sizingMethod="scale"); | |
} |
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
// find attribute | |
export function findInParent( node, attribute, levels = Infinity ) { | |
return node.getAttribute( attribute ) || | |
( levels > 0 ? findInParent( node.parentElement, attribute, --levels ) : null ); | |
} | |
// find anything | |
export function findInParent( node, filter, levels = Infinity ) { | |
return filter( node ) || |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
PS1='\nubi ${debian_chroot:+($debian_chroot)}\[\033[00;33m\]\u \[\033[00;32m\]\w\[\033[00;36m\]$(parse_git_branch)\[\033[00m\]:\n➜ ' | |
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 drawTriangle from "a-big-triangle"; | |
import createShader from "gl-shader"; | |
import createFBO from "gl-fbo"; | |
const vertex = [ | |
"precision mediump float;", | |
"attribute vec2 position;", | |
"void main() {", | |
" gl_Position = vec4( position, 1, 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
const path = require( "path" ); | |
const fs = require( "fs" ); | |
const license = new Buffer( `/** | |
* Copyright 2016 Google Inc. All rights reserved. | |
* | |
* Licensed under the Apache License, Version 2.0 (the "License"); | |
* you may not use this file except in compliance with the License. | |
* You may obtain a copy of the License at | |
* |
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
const spawn = require( "child_process" ).spawn; | |
var server; | |
gulp.task( "gae", function() { | |
if ( server ) server.kill(); | |
server = spawn( "python", [ | |
'C:/Users/<your user>/AppData/Local/Google/Cloud SDK/google-cloud-sdk/bin/dev_appserver.py', | |
"--port", "8080", |
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
using UnityEngine; | |
public struct Spherical { | |
public float Radius; | |
public float Phi; | |
public float Theta; | |
Spherical( float radius = 1f, float phi = 0f, float theta = 0f ) { | |
Radius = radius; |
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
export function tween( time, update ) { | |
const start = Date.now(); | |
var isCanceled = false; | |
var isComplete = false; | |
var chain = []; | |
function loop() { | |
if ( isCanceled ) return; |
OlderNewer