Skip to content

Instantly share code, notes, and snippets.

@bellbind
bellbind / texture.html
Created October 22, 2009 11:19
[WebGL] Texture example by 2d canvas
<!DOCTYPE html>
<html>
<head>
<script>//<!--
// WebGL texture example
top.CanvasFloatArray = top.CanvasFloatArray || WebGLFloatArray;
var gl;
var program;
@bellbind
bellbind / quaternion.js
Created January 26, 2012 03:10
[javascript]understanding quaternion
//[understanding quaternion]
// - basic vector knowledge
// - quaternion basics
// - quaternion multiply
// - rotation with quaternion
// - slerp
// - convert quaternion to matrix
//[(basic) vector func]
var negate = function (vec) {
@CristinaSolana
CristinaSolana / gist:1885435
Created February 22, 2012 14:56
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@clooth
clooth / resizyr.coffee
Created October 17, 2013 20:48
WebGL Photo resizer example
#
# Resizyr - WebGL Image Resizer
#
# Extensions
# This allows us to do for example the following:
# 5.times () -> console.log "foo"
#
Number::times = (fn) ->
do fn for [1..@valueOf()]
@natelandau
natelandau / .bash_profile
Last active January 4, 2025 14:58
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@danielgtaylor
danielgtaylor / gist:0b60c2ed1f069f118562
Last active April 2, 2024 20:18
Moving to ES6 from CoffeeScript

Moving to ES6 from CoffeeScript

I fell in love with CoffeeScript a couple of years ago. Javascript has always seemed something of an interesting curiosity to me and I was happy to see the meteoric rise of Node.js, but coming from a background of Python I really preferred a cleaner syntax.

In any fast moving community it is inevitable that things will change, and so today we see a big shift toward ES6, the new version of Javascript. It incorporates a handful of the nicer features from CoffeeScript and is usable today through tools like Babel. Here are some of my thoughts and issues on moving away from CoffeeScript in favor of ES6.

While reading I suggest keeping open a tab to Babel's learning ES6 page. The examples there are great.

Punctuation

Holy punctuation, Batman! Say goodbye to your whitespace and hello to parenthesis, curly braces, and semicolons again. Even with the advanced ES6 syntax you'll find yourself writing a lot more punctuatio

@genekogan
genekogan / _Instructions.md
Last active September 21, 2024 10:33
instructions for generating a style transfer animation from a video

Instructions for making a Neural-Style movie

The following instructions are for creating your own animations using the style transfer technique described by Gatys, Ecker, and Bethge, and implemented by Justin Johnson. To see an example of such an animation, see this video of Alice in Wonderland re-styled by 17 paintings.

Setting up the environment

The easiest way to set up the environment is to simply load Samim's a pre-built Terminal.com snap or use another cloud service like Amazon EC2. Unfortunately the g2.2xlarge GPU instances cost $0.99 per hour, and depending on parameters selected, it may take 10-15 minutes to produce a 512px-wide image, so it can cost $2-3 to generate 1 sec of video at 12fps.

If you do load the

/*
ofxFaceTracker provides an interface to Jason Saragih's FaceTracker library.
getImagePoint()/getImageMesh() are in image space. This means that all the
points will line up with the pixel coordinates of the image you fed into
ofxFaceTracker.
getObjectPoint()/getObjectMesh() are in 3d object space. This is a product of
the mean mesh with only the expression applied. There is no rotation or
translation applied to the object space.
@stsvilik
stsvilik / gulpfile.js
Last active June 4, 2019 11:24
Gulp browserify, babelify, uglify and concat vendor files
/*! gulpfile.js */
const gulp = require("gulp");
const gutil = require("gulp-util");
const browserify = require("browserify");
const buffer = require("vinyl-buffer");
const uglify = require("gulp-uglify");
const sourcemaps = require("gulp-sourcemaps");
const source = require("vinyl-source-stream");
const concat = require("gulp-concat")
<?php
//https://developers.facebook.com/docs/messenger-platform/account-linking
define('BOT_TOKEN', 'EAACmZAGF3rLkBAP1ZAeiUWnUXSkDtroxJ3OZBz1gHgScvB1YBUagg9iZCSQyFfKec76shZBmMcoqAD5MiRbPJQBxDDZBHZCGHsZAvfGSQUYC8ZBtZC0sEEhtEjmG1xuhpzEEptJsxJXhPfJDVMsoEGt60PWPpY1oYNEGu3KZB0uzfLKPgZDZD');
define('VERIFY_TOKEN', 'teste');
define('API_URL', 'https://graph.facebook.com/v2.6/me/messages?access_token='.BOT_TOKEN);
$hub_verify_token = null;
function processMessage($message) {