Skip to content

Instantly share code, notes, and snippets.

View HerrSpace's full-sized avatar
💭
🧠🔥

Space Meyer HerrSpace

💭
🧠🔥
View GitHub Profile
const int x[] = { 1,2,3,4 };
const int y[] = { 5,6,7,8 };
int buttonPressed[2] = {-1,-1};
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("test!");
for (int idx_x = 0; idx_x < 4; idx_x++) {
pinMode(idx_x, INPUT);
@HerrSpace
HerrSpace / video2gif.sh
Created May 5, 2014 18:54
Reference oneliner for converting videos to pleasant looking gifs
avconv -i input.mov -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 5 -loop 0 - output.gif
#define A 3
#define B 4
#define C 5
#define D 6
#define E 7
int matrix[4][4][2] =
{
{ {A, B}, {C, B}, {D, B}, {E, B} },
{ {A, C}, {B, C}, {D, C}, {E, C} },
#!/usr/bin/env python
import socket
import time
import random
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("94.45.224.223", 1234))
print("connected")
while True:
@HerrSpace
HerrSpace / gist:1af514af76f112953558
Last active August 29, 2015 14:18
subraum spam
#!/usr/bin/env python
import socket
import time
import random
from PIL import Image
img = Image.open("/home/space/subraum_cube_medium.png")
s = socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
s.connect(("2001:67c:20a1:1:201:2eff:fe2b:3f3a", 1234))
def rgbToHex(r, g, b):
rHex = hex(r)[2:]
gHex = hex(g)[2:]
bHex = hex(b)[2:]
colour = ""
for subColour in [rHex,gHex,bHex]:
if len(subColour) < 2:
colour += "0" + subColour
else:
@HerrSpace
HerrSpace / ips.cpp
Last active December 16, 2015 06:28
Just a quick reference of how to work with IPs.
#include <stdlib.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
void setup() {
Mouse.begin();
}
void loop() {
Mouse.move(0, 0, 0);
delay(20);
Mouse.move(0, 1000, 0);
delay(20);
Mouse.move(1000, 1000, 0);
void setup() {
Mouse.begin();
}
int count = 0;
void loop() {
count++;
int x = sin(count) * 200 + 500;
int y = asin(count) * 200 + 500;
void setup() {
Mouse.begin();
int count = 0;
}
void loop() {
count++:
int x = sin(count) * 200;
int y = asin(count) * 200;