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
// Fetches minted tokens from Versum, starting from the most recent -> older | |
// | |
// You can try this out in a REST app or curl'ing by calling a GET to | |
// https://versum.xyz/api/public/feed?offset=0&limit=10&maxtime=1649840640000 | |
// Returns a json object with the token data, creator wallet & info, and urls to the images on IPFS | |
// Use query string params 'offset' and 'limit' to paginate data | |
//... |
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
vec2 backgroundCoverUV(vec2 uv, vec2 resolution, vec2 texResolution) { | |
vec2 s = resolution; | |
vec2 i = texResolution; | |
float rs = s.x / s.y; | |
float ri = i.x / i.y; | |
vec2 new = rs < ri ? vec2(i.x * s.y / i.y, s.y) : vec2(s.x, i.y * s.x / i.x); | |
vec2 offset = (rs < ri ? vec2((new.x - s.x) / 2.0, 0.0) : vec2(0.0, (new.y - s.y) / 2.0)) / new; | |
return uv * s / new + offset; | |
} |
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
// difference between current and previous cursor position & distance | |
this.delta = pk.Vector.sub(this.lerped, this.plerped) | |
this.distance = this.delta.mag() | |
// paint repeatedly by interpolating the bristle’s stamp position over the course of distance | |
// then stamp the bristles texture onto the final render target by copying its pixels | |
let numDraws = this.distance || 1 | |
for (let i = 0; i < numDraws; i++) { | |
let ipos = pk.Vector.lerp(this.plerped, this.lerped, i / numDraws) | |
this.bristles.position = new PIXI.Point(ipos.x, ipos.y) |
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
#ifdef GL_ES | |
precision lowp float; | |
#endif | |
#define TWO_PI 6.28318530718 | |
uniform sampler2D videoTexture; | |
varying vec2 vUv; | |
uniform vec3 colorA; |
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 http = require('http') | |
var fs = require('fs') | |
var socket = require('socket.io') | |
var midi = require('midi') | |
var app = http.createServer() | |
var io = socket(app) | |
app.listen(5000) | |
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
float timeDiff = ofGetElapsedTimef() - lastPitchChangeTime; | |
if(roundedCurrPitch != roundedPrevPitch && pitchConfidence > minimumConf && timeDiff > pitchRelease) { | |
// first, send [off note] for previous note | |
midiOut.sendNoteOff(channel, roundedPrevPitch); | |
// send current note value over midi | |
// scale the ascii values to midi velocity range 0-127 | |
// see an ascii table: http://www.asciitable.com/ |
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
background-image: url('data:image/svg+xml;utf8,<svg></svg>'); |
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
{ | |
// http://eslint.org/docs/rules/ | |
"parser": "babel-eslint", | |
"env": { | |
"browser": true, // browser global variables. | |
"node": true, // Node.js global variables and Node.js-specific rules. | |
"worker": false, // web workers global variables. | |
"amd": false, // defines require() and define() as global variables as per the amd spec. |
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
this.$button.click(function(event){ | |
event.preventDefault(); | |
var $target = $(event.currentTarget); | |
// do stuff with target | |
}.bind(this)); |
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
// jquery fastclick integration | |
$(function() { | |
FastClick.attach(document.body); | |
}); |
NewerOlder