Skip to content

Instantly share code, notes, and snippets.

View vinzdef's full-sized avatar
🍋
][__( ͡~ ͜ʖ ͡°)__][

Vincent De Feo vinzdef

🍋
][__( ͡~ ͜ʖ ͡°)__][
View GitHub Profile
@vinzdef
vinzdef / smart-outline.js
Created September 17, 2020 14:51
Removes outlines when using a mouse
import {on, off} from '@okiba/dom'
const outlineClass = 'is-outline-hidden'
function disableOutline() {
on(window, 'keydown', enableOutline)
off(window, 'mousemove', disableOutline)
document.body.classList.add(outlineClass)
}
@vinzdef
vinzdef / index.js
Created August 6, 2019 11:18
Fork Process in Cluster
const server = require('./server.js')
const numCPUs = require('os').cpus().length
const cluster = require('cluster')
function makeCluster() {
return new Promise((resolve, reject) => {
if (cluster.isMaster) {
for (let i = 0; i < numCPUs; i++) {
cluster.fork()
}
@vinzdef
vinzdef / books.md
Last active February 10, 2019 09:24
Books of Humble Book Bundle: Break into the Game Industry by CRC Press

Creative Character Design

Vintage Games 2.0: An Insider Look at the Most Influential Games of All Time

Becoming a Video Game Artist: From Portfolio Design to Landing the Job

Digital Mayhem 3D Landscape Techniques: Where Inspiration, Techniques and Digital Art Meet

Honoring the Code: Conversations with Great Game Designers

@vinzdef
vinzdef / togif.sh
Created January 9, 2019 13:31
togif - quickly convert video to hq gif with ffmpeg
ffmpeg -i $1 -filter_complex "[0:v] fps=40,scale=800:-1,split [a][b];[a] palettegen [p];[b][p] paletteuse" ${1%.*}.gif
@vinzdef
vinzdef / kubesetup.md
Last active November 16, 2018 16:13
Kubernetes basic setup

Kubernetes basic setup

Huge thanks to Ani for showing me this

ON EVERY MACHINE (slaves and master)

Set hostname
nano /etc/hostname # Write your machine's IP
@vinzdef
vinzdef / drag-normalizer.js
Last active October 17, 2018 14:08
DragNormalizer
import EventEmitter from 'eventemitter3'
export default class DragNormalizer extends EventEmitter {
constructor(el) {
super()
this.el = el
this.autoBind()
this.addEventListeners()
}
const input = [
{ type: 'a', distance: 5 },
{ type: 'c', distance: 3 },
{ type: 'b', distance: 6 },
{ type: 'c', distance: 12 },
{ type: 'b', distance: 1 },
{ type: 'a', distance: 5 },
{ type: 'b', distance: 6 },
{ type: 'a', distance: -1 },
{ type: 'c', distance: 9 },
@vinzdef
vinzdef / Portfolio.json
Last active March 29, 2019 11:48
Collection of my works
[{
"sites": [{
"title": "Route Fifty",
"url": "https://routefifty.caffeina.com/",
"video": "https://player.vimeo.com/play/1271931823?s=325216846_1553860022_a73bd6a89b37aae36983c3e71e080100&loc=external&context=Vimeo%5CController%5CClipController.main",
"awards": "Mobile Excellence, AWWW Honors, CSSDA WOTD, UI / UX / Innovation CSSDA"
}, {
"title": "Evert 45",
"url": "https://www.evert45.com/",
"video": "https://assets.awwwards.com/awards/external/2017/06/594157429f5d9.mp4",
@vinzdef
vinzdef / SuperCollider_00.scd
Created January 20, 2018 15:49
SuperCollider 34C3 Assembly Intro
{
SinOsc.ar(
Line.kr(440, 220, 1), 0, 1
);
}.scope
SynthDef(\env_synth,{
Out.ar(0, SinOsc.ar(440));
}).add;
file="II.gif"
base="II"
convert $file -coalesce "${base}-coal.gif"
convert -size 1200x1080 "${base}-coal.gif" -resize 30% "${base}-small.gif"
convert "${base}-small.gif" frames%04d.png
#montage -background '#e177a8' -border 0 -tile 6x -quality 60% frames*.png "A-sheet.jpg"
ffmpeg -loop 1 -i bg.png -i frames%04d.png -filter_complex overlay=shortest=1 "II.mp4"