Skip to content

Instantly share code, notes, and snippets.

@kylemarsh
kylemarsh / Strings, Variables and Function Calls
Created August 14, 2012 19:33
Explaining a variable-passing problem a friend was having.
# 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"

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 / InfluxInstallation.md
Last active March 18, 2016 02:15
Install and Run InfluxDB on a DreamHost VPS

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.
@kylemarsh
kylemarsh / .htaccess
Last active August 29, 2015 14:25
Hello World for running Go under FCGI
# 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 / colorwave.ino
Last active January 19, 2016 01:46
ShiftBrite Playground -- Different sketches that I've come up with while working on a shiftbrite project
#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 / grb_plotter.py
Created January 24, 2016 19:25
Plot gamma ray burst data from the FERMI GBM Burst catalog using astropy
# 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 / reminder.sh
Created March 17, 2017 15:46
Variable-period notifier for OSX
#!/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 / config.g.diff
Last active September 24, 2021 07:06
Changes to Artemis 300 config.g to upgrade from RRFv2 to RRFv3
diff --git a/Artemis/system/config.g b/Artemis/system/config.g
index cf04275..1e5fe3a 100755
--- a/Artemis/system/config.g
+++ b/Artemis/system/config.g
@@ -5,13 +5,17 @@ M575 P1 B57600 S1 ; PanelDue Comm Setup
G21 ; Work in millimeters
G90 ; Send absolute coordinates
+M584 X0 Y1 Z2 E4:5 ; Set drive mapping
+