Skip to content

Instantly share code, notes, and snippets.

View badgeek's full-sized avatar
🎯
Focusing

Budi Prakosa a.k.a Iyok badgeek

🎯
Focusing
View GitHub Profile
@badgeek
badgeek / fgdfgfd.skema
Created March 17, 2021 10:02
the description for this gist
[{"name":"Bears","color":"Blue","position":{"x":177,"y":85},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c217","name":"id","type":"increments","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c218","name":"name","type":"string","length":"200","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"fish","relatedmodel":"Fish","relationtype":"hasOne","usenamespace":""},{"extramethods":"","foreignkeys":"","name":"trees","relatedmodel":"Trees","relationtype":"hasMany","usenamespace":""},{"extramethods":"","foreignkeys":"bear_id, picnic_id","name":"picnics","relatedmodel":"Picnics","relationtype":"belongsToMany","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Yellow","position":{"x":1063,"y":14},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"c
@badgeek
badgeek / Google Colab SSH
Created April 29, 2020 09:53 — forked from yashkumaratri/Google Colab SSH
SSH into google colab
#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(20))
#Download ngrok
! wget -q -c -nc https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
! unzip -qq -n ngrok-stable-linux-amd64.zip
#Setup sshd
@badgeek
badgeek / machine.js
Last active January 31, 2020 11:38
Generated by XState Viz: https://xstate.js.org/viz
const BasicMachine = Machine({
id: "basicmachine",
initial: "inactive",
context: {},
states: {
copying : {
id: "copying",
initial: "loading",
states: {
loading: {
@badgeek
badgeek / machine.js
Created January 31, 2020 09:50
Generated by XState Viz: https://xstate.js.org/viz
const BasicMachine = Machine({
id: "basicmachine",
initial: "inactive",
context: {},
states: {
copying : {
id: "copying",
initial: "loading",
states: {
loading: {
@badgeek
badgeek / SketchSystems.spec
Created March 19, 2019 09:27
My Awesome Sketch
My Awesome Sketch
First State
click -> Second State
exit -> Third State
Second State
exit -> Third State
Extra State
exit -> Third State
Extra State X
exit -> Third State
@badgeek
badgeek / dsfdsf.skema
Last active March 16, 2020 15:18
the description for this gist
[{"name":"Bears","color":"Blue","position":{"x":168,"y":76},"modelclass":"Bear","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c218","name":"name","type":"string","length":"200","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c217","name":"id","type":"increments","length":"0","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c219","name":"danger_level","type":"string","length":"200","order":2,"defaultvalue":"","enumvalue":""}],"relation":[{"extramethods":"","foreignkeys":"","name":"test","relatedmodel":"Trees","relationtype":"hasOne","usenamespace":""}],"seeding":[]},{"name":"Fish","color":"Red","position":{"x":890,"y":126},"modelclass":"Fish","increment":false,"timestamp":false,"softdelete":false,"column":[{"colid":"c238","name":"weight","type":"integer","length":"0","order":0,"defaultvalue":"","enumvalue":""},{"colid":"c239","name":"bear_id","type":"integer","length":"0","order":1,"defaultvalue":"","enumvalue":""},{"colid":"c237","name":"id","type":"increments","length"
//- - - - - - - - - - - - OSC - - - - - - - - - - - -
OSCMessage osc_msg_rcv;
int size = Udp.parsePacket();
if (size > 0) {
while (size--) {
osc_msg_rcv.fill(Udp.read());
}
if (!osc_msg_rcv.hasError()) {
if(osc_msg_rcv.fullMatch("/ASIK", 0))
{
#define ENABLE_WIFI
//#define ENABLE_WIFI_AP
#define ENABLE_DEBUG
//#define ENABLE_BROADCAST
#ifdef ENABLE_WIFI
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <WiFiClient.h>
#define ENABLE_WIFI
//#define ENABLE_WIFI_AP
#define ENABLE_DEBUG
//#define ENABLE_BROADCAST
#ifdef ENABLE_WIFI
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <WiFiClient.h>
@badgeek
badgeek / gist:db1181654b9652a174d1dfbbc6584685
Created June 30, 2018 07:25
hardware spi max6675 on nodemcu
#include <ESP8266WiFi.h>
#include <ESP8266mDNS.h>
#include <WiFiUdp.h>
#include <ArduinoOTA.h>
//#define MAX6675_LIBRARY_HW_SLOWDOWN
#include <max6675.h>
#include <SPI.h>
const char* ssid = "RUMAH";