Skip to content

Instantly share code, notes, and snippets.

View henriquegogo's full-sized avatar

Henrique Gogó henriquegogo

View GitHub Profile
@henriquegogo
henriquegogo / .profile
Created May 7, 2019 02:42
Run startx after login
# ...
# Run startx on boot
if [[ ! $DISPLAY && XDG_VTNR -eq 1 ]]; then
exec startx
fi
@henriquegogo
henriquegogo / jsc-env.js
Created March 8, 2019 04:24
Run jsc (JavaScriptCore) with CommonJS require and console.log functions. Usage: $ jsc jsc-env.js YOURSCRIPT.js
console = { log: print };
exports = {};
require = function() { load(...arguments); return exports };
@henriquegogo
henriquegogo / receita.json
Created March 1, 2019 20:34
Exemplo para requisições
{
"titulo": "Receita de bolo da vovó",
"ingredientes": [
"Farinha", "Ovo", "Açúcar", "Pipoca"
]
}
@henriquegogo
henriquegogo / makeRequest.go
Last active January 9, 2019 19:48
Make request and parse json into Go struct collection, map to another struct collection and print
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type gist struct {
ID string `json:"id"`
@henriquegogo
henriquegogo / cotacoes
Created November 30, 2018 16:51
Refresh my stocks watchlist every 5 secs on command line using https://github.com/pstadler/ticker.sh
watch -n 5 -t -c /opt/apps/ticker.sh ^BVSP EZTC3.SA PSSA3.SA TCSA3.SA TAEE11.SA TIET11.SA BBSE3.SA MPLU3.SA ITSA4.SA ITSA3.SA FEXC11.SA KNIP11.SA MXRF11.SA IVVB11.SA ^GSPC USDBRL=X BZ=F CL=F BTC-USD
@henriquegogo
henriquegogo / game.js
Created September 26, 2018 06:33
Game prototype
class Person {
constructor(name) {
this.name = name;
this.age = 0;
this.cash = 0;
this.job = undefined;
this.properties = [];
this.children = [];
}
@henriquegogo
henriquegogo / wpa_supplicant.conf
Created August 15, 2018 04:24
wpa supplicant config for simple network and PEAP network authentications
country=BR
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="MYNETWORK"
psk="PASSWORD"
}
network={
@henriquegogo
henriquegogo / fix_rpi3_jack_noise.md
Last active August 15, 2018 04:21
Fix Raspberry Pi 3 B+ audio jack noise
@henriquegogo
henriquegogo / load_soundfont_to_midi.sh
Created August 15, 2018 03:59
Load soundfont and plug into midi device
#!/bin/bash
fluidsynth --audio-bufcount=4 --gain=1 -isa alsa "$1" &
while ! aconnect 20 128; do sleep 1; done
@henriquegogo
henriquegogo / 99-midi-keyboard.rules
Created August 15, 2018 03:50
udev - Detect USB device and launch an action
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="nanoKEY2", TAG+="systemd", ENV{SYSTEMD_WANTS}="midi-keyboard-drums.service"
SUBSYSTEM=="usb", ACTION=="remove", ENV{ID_MODEL}=="nanoKEY2", RUN+="/usr/bin/killall fluidsynth"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="UMX_61", TAG+="systemd", ENV{SYSTEMD_WANTS}="midi-keyboard-rhodes.service"
SUBSYSTEM=="usb", ACTION=="remove", ENV{ID_MODEL}=="UMX_61", RUN+="/usr/bin/killall fluidsynth"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="nanoKEY2", RUN+="/usr/bin/killall emulationstation"
SUBSYSTEM=="usb", ACTION=="add", ENV{ID_MODEL}=="UMX_61", RUN+="/usr/bin/killall emulationstation"