Skip to content

Instantly share code, notes, and snippets.

// Basic demo for accelerometer readings from Adafruit MPU6050
#include <Adafruit_MPU6050.h>
#include <Wire.h>
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
#include "driver/pcnt.h"
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"strings"
#define PIN01 9
#define PIN02 8
#define PIN03 7
#define PIN04 6
#define PIN05 5
#define PIN06 4
#define PIN07 3
#define PIN08 2
#define PIN09 11
@cirias
cirias / decode.go
Created April 18, 2018 07:16
Golang decode 7bit text
package main
import (
"encoding/hex"
"fmt"
)
func main() {
const sample = "54747A0E4ACF4161D00D244ED341F4329E1E02"
@cirias
cirias / setup.sh
Last active April 2, 2018 08:58
SSH using GPG on Ubuntu 17.10
cat > ~/.gnupg/gpg-agent.conf <<EOF
default-cache-ttl 600
max-cache-ttl 7200
enable-ssh-support
EOF
gpgconf --kill gpg-agent
gpg-connect-agent reloadagent /bye
# man gpg-agent
<div id="main">
<div id="window">
<div class="parent"></div>
</div>
</div>
<style>
div#main {
width: 100%;
}
package hanabi
import (
"math/rand"
"time"
)
const (
white = iota
yellow
@cirias
cirias / game.txt
Last active December 15, 2017 03:40
life
x
x x
xx xx xx
x x xx xx
xx x x xx
xx x x xx x x
x x x
x x
xx
@cirias
cirias / watch.sh
Created December 14, 2017 07:47
watch and execute
#!/bin/bash
# monitor STDIN
# run command when interval of lines come in smaller than sepecific duration
DURATION=2 # in seconds
LINES_COUNT=1
COMMAND="echo Aha!"
SECONDS=$DURATION
@cirias
cirias / a.ino
Last active August 8, 2016 11:19
#include "PinChangeInterrupt.h"
// Choose a valid PinChangeInterrupt pin of your Arduino board
#define pcintThrottle 12 // A4
#define pcintAileron 13 // A5
/* #define pcintThrottle 13 // A4 */
volatile int thro_pwm_value = 0;
volatile int thro_prev_time = 0;
volatile int aile_pwm_value = 0;