Skip to content

Instantly share code, notes, and snippets.

@jackgu1988
jackgu1988 / sonic-pi-tutorial.md
Created September 9, 2018 13:09 — forked from jwinder/sonic-pi-tutorial.md
Sonic Pi in-app tutorials concatenated - last synced 2018-07-17 - https://sonic-pi.net/tutorial - https://github.com/samaaron/sonic-pi

1 Welcome to Sonic Pi

Welcome friend :-)

Welcome to Sonic Pi. Hopefully you're as excited to get started making crazy sounds as I am to show you. It's going to be a really fun ride where you'll learn all about music, synthesis, programming, composition, performance and more.

@jackgu1988
jackgu1988 / checkmail.py
Created March 15, 2018 15:19 — forked from jonathanhculver/checkmail.py
Python script to check gmail for new email every minute and send to Arduino over serial.
import imaplib, serial, struct, time
class Mail():
def __init__(self):
self.user= 'USER'
self.password= 'PASS'
self.ser = serial.Serial('/dev/tty.usbmodem621', 9600)
self.M = imaplib.IMAP4_SSL('imap.gmail.com', '993')
self.M.login(self.user, self.password)
int sensorValue1 = 0;
int sensorValue2 = 0;
boolean s1 = false;
boolean s2 = false;
int sensorValue = 0;
float sensorPressed[] = {0, 0};
float prop = 0;
@jackgu1988
jackgu1988 / key_generation.py
Created February 19, 2017 15:48 — forked from mbenedettini/key_generation.py
Python implementation of Mifare AES-128 simmetric key diversification, as described in document AN10922
from Crypto.Cipher import AES
from bitstring import BitArray, Bits
(key, m) = (BitArray(hex='00112233445566778899AABBCCDDEEFF'), BitArray(hex='00000000000000000000000000000000'))
const_rb = BitArray(hex='00000000000000000000000000000087')
k0 = BitArray(hex=AES.new(key.bytes).encrypt(m.bytes).encode('hex'))
@jackgu1988
jackgu1988 / adwaita-fix.md
Created February 19, 2017 11:55
Icons missing from Adwaita icon theme in Fedora 25 XFCE spin

I noticed that icons are missing in some applications from the adwaita-icon-theme, like from netwok manager notifications, and midori URL bar. Here is the fix:

sudo dnf install gnome-icon-theme-extras gnome-icon-theme-legacy gnome-icon-theme-symbolic

@jackgu1988
jackgu1988 / MainActivity.java
Created February 1, 2017 19:57
Android code to detect when the user is lowering the device v2
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
public class MainActivity extends AppCompatActivity implements SensorEventListener {
@jackgu1988
jackgu1988 / MainActivity.java
Created February 1, 2017 17:41
Android code to detect when the user is lowering the device
import android.hardware.Sensor;
import android.hardware.SensorEvent;
import android.hardware.SensorEventListener;
import android.hardware.SensorManager;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
public class MainActivity extends AppCompatActivity implements SensorEventListener {
@jackgu1988
jackgu1988 / openpgp.txt
Created December 19, 2016 12:35
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:1a1b08ba0bda14f720a336d39f4939c3e7358a76]
@jackgu1988
jackgu1988 / spotify_fedora_22.md
Created August 17, 2015 11:58
Install Spotify on Fedora 22 x86_64

I had trouble installing Spotify on Fedora 22 x86_64, so here you go:

  • Add the rpmfusion repos (http://rpmfusion.org/Configuration) - I won't go into details, there are plenty tutorials online
  • Run: sudo dnf install lpf-spotify-client
  • After you run it, add yourself to the group, logout and log back in.
  • Run: lpf-gui
  • Build Spotify (if it fails the first time, try again)
  • Add red's repo for libgcrypt.so.11 compatibility by running:
  • cd /etc/yum.repos.d
  • sudo wget https://copr.fedoraproject.org/coprs/red/libgcrypt.so.11/repo/fedora-22/red-libgcrypt.so.11-fedora-22.repo