Skip to content

Instantly share code, notes, and snippets.

@hugohil
hugohil / nextboot.md
Last active February 1, 2023 14:51
rename raspberry at next boot

create a file name nextboot.sh

#!/bin/bash

basename="nextboot"

uuid=$(cat /proc/sys/kernel/random/uuid)
echo $uuid
@hugohil
hugohil / initial-raspberry-install.md
Last active February 1, 2023 13:54
raspberry pi initial setup

update system

sudo apt update
sudo apt upgrade -y

install oh-my-zsh

sudo apt install zsh -y
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
@hugohil
hugohil / frag.glsl
Created October 11, 2022 14:39
Basic GLSL shaders (three.js)
uniform float time;
uniform vec2 resolution;
uniform vec3 color;
void main() {
gl_FragColor = vec4(color, 1.);
}
@hugohil
hugohil / three.js.shader.html
Created October 11, 2022 14:26 — forked from kylemcdonald/three.js.shader.html
Minimal three.js shader example.
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
<style>
body {
margin: 0px;
overflow: hidden;
}
@hugohil
hugohil / ThreadedModelLoader.cpp
Last active May 16, 2018 17:00
ofThreadedModelLoader
#include "ThreadedModelLoader.h"
#include <sstream>
ThreadedModelLoader::ThreadedModelLoader(){
nextID = 0;
ofAddListener(ofEvents().update, this, &ThreadedModelLoader::update);
startThread();
lastUpdate = 0;
loading = false;
@hugohil
hugohil / convert-images-pot.sh
Created May 8, 2018 09:06
media conversion scripts
#!/bin/sh
for i in medias/*.jpg;
do name=`echo $i | cut -d'.' -f1`;
# # this one looks for the previous pot
# p2w=$(convert "$i" -format "%[fx:2^(floor(log(w)/log(2)))]" info:)
# p2h=$(convert "$i" -format "%[fx:2^(floor(log(h)/log(2)))]" info:)
# # this one looks for the next pot
# p2w=$(convert "$i" -format "%[fx:2^(ceil(log(w)/log(2)))]" info:)
# p2h=$(convert "$i" -format "%[fx:2^(ceil(log(h)/log(2)))]" info:)
@hugohil
hugohil / webmidi-playground.js
Created January 24, 2018 11:23
test of webmidi
const WebMidi = require('webmidi')
const name = 'LPD8 MIDI 1'
WebMidi.enable((err) => {
err && console.warn(err)
WebMidi.inputs.forEach((input) => {
console.info(`${input.manufacturer} '${input.name}' ${input.state}`)
})
@hugohil
hugohil / index.js
Last active January 8, 2018 14:06
meyda multiple source and analyzers
/* to run:
budo index.js --live
uncomment the `source.connect(context.destination)` to hear tracks
*/
'use strict'
const Meyda = require('../../path/to/meyda') // use your local meyda installation
@hugohil
hugohil / arduinoled.ino
Created December 4, 2017 10:02
arduinoled-test
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
unsigned long frame = 0;
const float pi = 3.14;
@hugohil
hugohil / Page.vue
Last active September 10, 2020 06:33
spritesheet vue component
<template>
<div id="wrapper">
<sprite :id="'sprite'"
:spritesheet="require('../assets/spritesheet.png')"
:json="require('../assets/spritesheet.json')"
:yoyo="false"
:fps="30"
ref="sprite"
></sprite>
<button @click="play">play</button>