Skip to content

Instantly share code, notes, and snippets.

View marklundin's full-sized avatar
🐳

Mark Lundin marklundin

🐳
View GitHub Profile
export class MyClass {
/**
* @attribute
* Adding an attribute tag tag in a block comment flags the property as an attribute to the editor.
*/
speed = 10
class Rotator {
/**
* @attribute
* Including the `@attribute` block tag exposes the property to the editor.
*/
speed = 10
/**
@marklundin
marklundin / __start__.js
Created March 21, 2024 10:57
Add Custom App Handlers
(function () {
// Shared Lib
var CANVAS_ID = 'application-canvas';
// Needed as we will have edge cases for particular versions of iOS
// returns null if not iOS
var getIosVersion = function () {
if (/iP(hone|od|ad)/.test(navigator.platform)) {
var v = (navigator.appVersion).match(/OS (\d+)_(\d+)_?(\d+)?/);
var version = [parseInt(v[1], 10), parseInt(v[2], 10), parseInt(v[3] || 0, 10)];
@marklundin
marklundin / gist:111f1aa903ea634954439c9ce6b787ff
Last active September 10, 2018 14:23
Bose LS650 - Chocolatey
Install-ChocolateyZipPackage -PackageName armirror-noisecancelling -Url https://cloudbuild-33393.firebaseapp.com/we-are-kuva/bose/noisecancelling-rollout/build.zip -UnzipLocation "$env:UserProfile\Desktop\Experience"
Install-ChocolateyPinnedTaskBarItem -TargetFilePath "$env:UserProfile\Desktop\Experience\NoiseCancelling.exe"
@marklundin
marklundin / index.js
Created November 7, 2017 23:33
requirebin sketch
//const Vue = require('vue')
var VueProgressiveImage = require('vue-progressive-image').default;
Vue.use( VueProgressiveImage )
const data = {display: true}
new Vue({ el: '#app', data:data });
data.display = false
@marklundin
marklundin / glsl
Created February 13, 2017 18:09
Basic transition
/*
GPGPU
*/
attr vec2 p; // current position
attr vec2 endP; // Final resting position in final image
/*
Animate this between 0 and 1
(0 == use curl movement) (1 == move towards endP)
vec3 parallaxCorrectNormal( vec3 v, vec3 cubeSize, vec3 cubePos ) {
vec3 nDir = normalize(v);
vec3 rbmax = ( .5 * ( cubeSize - cubePos ) - pos ) / nDir;
vec3 rbmin = ( - .5 * ( cubeSize - cubePos ) - pos ) / nDir;
vec3 rbminmax;
rbminmax.x = ( nDir.x > 0. )?rbmax.x:rbmin.x;
rbminmax.y = ( nDir.y > 0. )?rbmax.y:rbmin.y;
rbminmax.z = ( nDir.z > 0. )?rbmax.z:rbmin.z;
@marklundin
marklundin / original
Last active May 3, 2016 16:04 — forked from Samsy/branch one
Branching
varying vec2 vUv;
uniform sampler2D tDiffuse;
uniform float isPicking;
void main() {
vec3 color = texture2D(tDiffuse, vUv).rgb;
gl_FragColor = vec4( mix( color, pickingColor, isPicking ), 1.0);
@marklundin
marklundin / api.js
Last active February 2, 2016 15:24
/*
Propsed visualisation API
*/
( canvas ) => {
start(), // Starts the render loop
pause, // Pauses the render loop, could fade out (may not be needed)
resize( w, h ), //
clear(), // clears the canvas. Note that if the artwork is not paused, it will be redrawn in the next frame
var visualisation = new ToyotaExp( canvas )
visualisation.on( 'render', function(){
yourCallBack( +new Date() )
})