Skip to content

Instantly share code, notes, and snippets.

View devries's full-sized avatar
🏠
Working from home

Christopher De Vries devries

🏠
Working from home
View GitHub Profile
@devries
devries / cylon_eye.ino
Created September 21, 2014 20:19
Cool Neon Cylon Eye (originally from Mike Winter, possibly modified)
#include <SPI.h>
//LightStrand_RobotMike
//by Mike Winter
//version 3
//Demonstrates chaseing lights
//Intented use: testing LED interface
//Code State: experimental, but it worked for me with 25 lights
//Concept: user adjust Pots to make a color. Color travels down strand of lights
//SPI Interface to strand based on Keith's excellent SPI code, thanks Keith
@devries
devries / json_object.py
Last active August 29, 2015 14:25
A JSON library with an object encoder for python
#!/usr/bin/env python
import json
from datetime import datetime
class ObjectEncoder(json.JSONEncoder):
def default(self,obj):
try:
return json.JSONEncoder.default(self,obj)
except TypeError:
pass
@devries
devries / de.py
Created October 29, 2016 19:45
Differential Evolution (short teach version without comments)
#!/usr/bin/env python
import numpy.random as random
def de_population(pmin,pmax,np):
"""Create a population of np randomly distributed sets of floating point
parameters whose elements are uniformly distributed between the values
in the array pmin and the values in pmax. Return a list of np of these
arrays.
pmin - minimum parameter values
@devries
devries / rainbling.ino
Last active December 22, 2016 00:29
Rainbling: A Total Control Lighting Arduino Sketch for rainbows with flashes.
/**************************************************************
* rainbling.ino
*
* An idea for having rainbow colors appear in groups (totems)
* with occasional flashes.
***************************************************************/
#include <SPI.h>
#include <TCL.h>
const int REPEATS = 24;
@devries
devries / keybase.md
Created January 10, 2017 21:52
Keybase identity

Keybase proof

I hereby claim:

  • I am devries on github.
  • I am idolstar (https://keybase.io/idolstar) on keybase.
  • I have a public key ASDjQ7wmNg3jKlaiv6K55IgdJqaJ9w_CI-UISWDjnYZV7Ao

To claim this, I am signing this object:

@devries
devries / cos-cloud-config.cfg
Last active March 14, 2017 19:28
Google Container Optimized OS User-data
#cloud-config
users:
- name: cloudservice
uid: 2000
write_files:
- path: /etc/systemd/system/cloudservice.service
parmissions: 0644
owner: root
@devries
devries / ca.md
Created June 3, 2018 13:25 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@devries
devries / Dockerfile
Created June 3, 2018 16:27
Alpine Python Dockerfile notes
FROM python:3.6-alpine
RUN apk add --update \
gcc \
make \
musl-dev \
libuv-dev \
linux-headers \
libxml2-dev \
libxslt-dev \
@devries
devries / rainbow.py
Created September 29, 2018 19:25
Writing over SPI to TCL LEDs from python
#!/usr/bin/env python
import time
import math
def main():
#fout = open('spidev','w')
fout = open('/dev/spidev2.0', 'w')
ctr = 0
@devries
devries / singleton_main.go
Last active October 29, 2018 15:57
Singleton Example for Go
package main
import (
"fmt"
"sync"
"time"
)
func main() {
go setter()