Skip to content

Instantly share code, notes, and snippets.

View HerrSpace's full-sized avatar
💭
🧠🔥

Space Meyer HerrSpace

💭
🧠🔥
View GitHub Profile
@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;
# Ignored by AndroidStudio
*.iws
# Folders related to builds
.gradle/
*/build/
# Local settings (regenerated by Android Studio)
.idea/workspace.xml
local.properties
<!DOCTYPE html>
<html lang="en">
<head>
<title>WebSocket Client</title>
<style>
#output {
border: solid 1px #000;
}
</style>
</head>
@HerrSpace
HerrSpace / gist:8529801
Last active January 3, 2016 22:39
Pretty LED stuff.
#include <Adafruit_NeoPixel.h>
#define PIN 6
#define NumberPixels 60
#define FadeFrames 6
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
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} },