The protocol should be text based and use TCP as the primary communication method: TCP communication streams are simpler to maintain and more reliable than UDP streams. A Java class can be used to hold String
constants that correspond with each of the commands.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aptitude install -y git curl python-dev python-pip redis-server ruby1.9.1-full rubygems1.9.1 | |
aptitude install -y mysql-server libmysqlclient-dev | |
adduser --system --shell /bin/sh --gecos 'git version control' --group --disabled-password --home /home/git git | |
adduser --disabled-login --gecos 'gitlab system' gitlab | |
usermod -a -G git gitlab | |
su - gitlab | |
ssh-keygen -q -N '' -t rsa -f /home/gitlab/.ssh/id_rsa | |
aptitude install gitolite | |
cp /home/gitlab/.ssh/id_rsa.pub /home/git/gitlab.pub | |
su - git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; courtesy of Gordon Gustafson on StackOverflow | |
; originally posted 2014-03-15 | |
; http://stackoverflow.com/questions/18102004/emacs-evil-mode-how-to-create-a-new-text-object-to-select-words-with-any-non-sp | |
(defmacro define-and-bind-text-object (key start-regex end-regex) | |
(let ((inner-name (make-symbol "inner-name")) | |
(outer-name (make-symbol "outer-name"))) | |
`(progn | |
(evil-define-text-object ,inner-name (count &optional beg end type) | |
(evil-regexp-range count beg end type ,start-regex ,end-regex t)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ArrayList<Sprite> sprites; | |
int current = 0; | |
void setup() { | |
size(400, 400); | |
sprites = new ArrayList<Sprite>(); | |
sprites.add(new Sprite(width/2, height/2)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import RPi.GPIO as GPIO | |
import time | |
GPIO.setmode(GPIO.BCM) | |
PIR_PIN = 7 | |
GPIO.setup(PIR_PIN, GPIO.IN) | |
def MOTION(PIR_PIN): | |
print 'Motion Detected!' | |
print 'PIR Module Test (CTRL+C to exit)” |
I hereby claim:
- I am natemara on github.
- I am natemara (https://keybase.io/natemara) on keybase.
- I have a public key whose fingerprint is DDB6 2313 92BA E5BA D425 8D44 5A78 67ED E2BD 6900
To claim this, I am signing this object:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Sum(object): | |
def __init__(self): | |
self._sum = 0 | |
def increment(self, val): | |
self._sum += val | |
def print_sum(self): | |
print self._sum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from serial import Serial | |
import sys | |
import requests | |
def main(): | |
serial_port = find_port() | |
while True: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
provider "docker" { | |
host = "unix:///var/run/docker.sock" | |
} | |
resource "docker_container" "foo" { | |
image = "${docker_image.alpine.latest}" | |
name = "foo" | |
command = ["/bin/cat", "/etc/issue"] | |
} |
OlderNewer