Skip to content

Instantly share code, notes, and snippets.

View codehz's full-sized avatar
🌸

Neko Hz codehz

🌸
View GitHub Profile
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
uniform vec2 resolution;
uniform vec2 offset;
uniform sampler2D backbuffer;
uniform vec3 gravity;
#include <iostream>
template<typename Target, typename Source>
struct force_cast {
union {
Source source;
Target target;
};
force_cast(Source source) : source(source) {};
@codehz
codehz / arrAction.js
Created July 12, 2016 16:21
Action delete, moveUp and moveDown
playListAction({action, index}) {
switch (action) {
case 'delete':
this.playList.splice(index, 1);
break;
case 'moveUp':
this.playList.splice((index - 1 + this.playList.length) % this.playList.length, 0, this.playList.splice(index, 0));
break;
case 'moveDown':
this.playList.splice((index + 1) % this.playList.length, 0, this.playList.splice(index, 0));