Skip to content

Instantly share code, notes, and snippets.

View bindy's full-sized avatar
🌴
On vacation

bindy bindy

🌴
On vacation
  • Tencent
  • Shenzhen
View GitHub Profile
@komietty
komietty / canvas.vue
Created November 11, 2017 09:16
pixi in vue
<template lang="html">
<div :class="'img-'+this.mainImgID" id="cvs_thumnails_box">
<canvas id="cvs">
</canvas>
<div id="thumbnails">
<div v-for="t in thumbnails" @click="changeImg(t.id)" :class="'thumbnail-'+ t.id" class="thumbnail">
</div>
</div>
</div>
</template>
@wassname
wassname / permutations.js
Last active June 28, 2022 22:53
Combinatorics permutatons and product in javascript using lodash.js (like python's itertools)
/**
* Lodash mixins for combinatorics
* by: wassname & visangela
* url: https://gist.github.com/wassname/a882ac3981c8e18d2556/edit
* lodash contrib issue: https://github.com/node4good/lodash-contrib/issues/47
* lic: same as lodash
* Inspired by python itertools: https://docs.python.org/2.7/library/itertools.html
*
* Usage:
* permutations([0,1,2],2) // [[0,1],[0,2],[1,0],[1,2],[2,0],[2,1]]
@mozillazg
mozillazg / supervisord.service
Last active December 1, 2023 12:59 — forked from tonyseek/supervisord.service
install and configure supervisord on centos 7.
[Unit]
Description=supervisord - Supervisor process control system for UNIX
Documentation=http://supervisord.org
After=network.target
[Service]
Type=forking
ExecStart=/bin/supervisord -c /etc/supervisord/supervisord.conf
ExecReload=/bin/supervisorctl reload
ExecStop=/bin/supervisorctl shutdown
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active March 9, 2025 18:57
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@nick-jonas
nick-jonas / bubbles-canvas.js
Last active October 24, 2016 02:55
Animating bubbles using Canvas
// called once, to initialize
createBubbles: function(){
var self = this,
el = this.element,
width = $(window).width(),
height = $(window).height(),
canvas = document.createElement('canvas');
el.style.width = canvas.width = width;
el.style.height = canvas.height = height;
@hagino3000
hagino3000 / client.js
Created December 8, 2011 18:42
WebSocket with binary data
var socket = null;
function bootstrap() {
// 適当な図形を描画
var c = document.getElementById('mycanvas');
var ctx = c.getContext('2d');
ctx.globalalpha = 0.3;
for(var i=0; i<1000; i++) {
ctx.beginPath();