Skip to content

Instantly share code, notes, and snippets.

View MarkKropf's full-sized avatar

Mark Kropf MarkKropf

View GitHub Profile
@MarkKropf
MarkKropf / gist:6160024
Created August 5, 2013 22:08
Octobars / Shiftbrite ( Allegro A6281 ) SPI Packet Sender
def sb_SendPacket(r=0,g=0,b=0,c=0b00,packet=0)
packet = (packet << 2) | (c & 0b11)
packet = (packet << 10) | (b)
packet = (packet << 10) | (r)
packet = (packet << 10) | (g)
bits = packet.to_s(2).rjust(32, "0").chars.to_a
bits.insert(22, "_").insert(12, "_").insert(2, "_").insert(1, "_")
bit_str = bits.join("")
c_str = c.to_s(2).rjust(2,"0")
r_str = r.to_s(2).rjust(10,"0")
@MarkKropf
MarkKropf / tmux.md
Created February 18, 2014 22:31 — forked from andreyvit/tmux.md

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@MarkKropf
MarkKropf / gist:11240271
Created April 24, 2014 03:16
sb_SendPacket
def sb_SendPacket(r=0,g=0,b=0,c=0b00,packet=0)
packet = (packet << 2) | (c & 0b11)
packet = (packet << 10) | (b)
packet = (packet << 10) | (r)
packet = (packet << 10) | (g)
bits = packet.to_s(2).rjust(32, "0").chars.to_a
bits.insert(22, "_").insert(12, "_").insert(2, "_").insert(1, "_")
bit_str = bits.join("")
c_str = c.to_s(2).rjust(2,"0")
r_str = r.to_s(2).rjust(10,"0")

Keybase proof

I hereby claim:

  • I am markkropf on github.
  • I am markkropf (https://keybase.io/markkropf) on keybase.
  • I have a public key whose fingerprint is 9BB0 90B8 D4BF 3FB4 C4C8 2C78 B8A0 125B 4E32 B57F

To claim this, I am signing this object:

[
{
"protocol": "tcp",
"destination": "10.244.0.34",
"ports": "80"
}
]