Skip to content

Instantly share code, notes, and snippets.

Avatar

Kyle Marsh kylemarsh

  • DreamHost
View GitHub Profile
@kylemarsh
kylemarsh / reminder.sh
Created Mar 17, 2017
Variable-period notifier for OSX
View reminder.sh
#!/bin/sh
# Variable-period notifier for OSX
# Requires the following (available via homebrew):
# terminal-notifier (https://github.com/julienXX/terminal-notifier)
# reattach-to-user-namespace (https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard)
# See below for information about reattach-to-user-namespace (necessary to connect to notifications via `at`):
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard#mac-os-x-pasteboard-access-under-tmux-and-screen
##########
@kylemarsh
kylemarsh / grb_plotter.py
Created Jan 24, 2016
Plot gamma ray burst data from the FERMI GBM Burst catalog using astropy
View grb_plotter.py
# Code to generate a dotfield for my galaxy top hat*. Rather than placing my
# "stars" randomly, I wanted to use a pattern based in real astronomy data
# of some sort. In browsing online I realized for the first time how to read
# those elliptical maps of the sky you see astronomers use all the time. I
# decided to get data from the equator of one of those maps to put around my
# hat.
#
# Unfortunately, all the maps I could find were either too dense or too
# sparse so I realized I'd have to dig into the actual data myself and
# generate an appropriate map. I decided on detected Gamma Ray Bursts**
@kylemarsh
kylemarsh / colorwave.ino
Last active Jan 19, 2016
ShiftBrite Playground -- Different sketches that I've come up with while working on a shiftbrite project
View colorwave.ino
#include "shiftbrite.h" // See https://github.com/kylemarsh/particle_shiftbrite
#define latchpin D0 // replace with pin you use for the latch
#define numleds 4 // Number of LEDs in your chain
typedef struct {
uint16_t red;
uint16_t green;
uint16_t blue;
} rgb;
@kylemarsh
kylemarsh / .htaccess
Last active Aug 29, 2015
Hello World for running Go under FCGI
View .htaccess
# Rename the binary created from hello-fcgi.go to "fcgitest.fcgi"
# chmod 755 fcgitest.fcgi
# Credit goes to http://www.dav-muz.net/blog/2013/09/how-to-use-go-and-fastcgi/
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d [OR]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^(.*)$ fcgitest.fcgi/$1 [QSA,L]
@kylemarsh
kylemarsh / InfluxInstallation.md
Last active Mar 18, 2016
Install and Run InfluxDB on a DreamHost VPS
View InfluxInstallation.md

Installing InfluxDB on a DreamHost VPS

Get the VPS

  1. If you don't already have one (or you want InfluxDB to have its own) Head to [the panel][0] and get thyself a VPS!
  2. Hit the "Configure" button and on the next page, the "Public Keys" link in the "Root SSH Keys" section.
  3. Create (or upload) a new keypair for your VPS. Safe the private key to your local ~/.ssh/ps123456.rsa or something.
  4. Head over to the [users section][1] and add a new, non-admin user (this example will use newinfluxdb). We'll come back to this later.
View keybase.md

Keybase proof

I hereby claim:

  • I am kylemarsh on github.
  • I am kmarsh (https://keybase.io/kmarsh) on keybase.
  • I have a public key whose fingerprint is EBFF 6745 81C5 A3CA 90F6 2B27 690B ACB4 B1F0 BC2D

To claim this, I am signing this object:

@kylemarsh
kylemarsh / Strings, Variables and Function Calls
Created Aug 14, 2012
Explaining a variable-passing problem a friend was having.
View Strings, Variables and Function Calls
# Basics (things you already know)
"abc" # the string "abc"
SomeVar = "abc" # SomeVar is a variable whose value is the string "abc"
func() # func is a function we're calling with no arguments
func("abc") # call func and pass the string "abc" as the first argument
func(SomeVar) # call func and pass the value stored in the variable SomeVar as the first argument
# Extrapolating from the basics
"abc" + "def" # append the string "def" to the string "abc". result is the string "abcdef" *string append may be different in Access
"def" + SomeVar # append the value stored in SomeVar to the string "def". result is the string "defabc" if SomeVar contains "abc"
You can’t perform that action at this time.