Skip to content

Instantly share code, notes, and snippets.

View SpencerCDixon's full-sized avatar

Spencer Dixon SpencerCDixon

View GitHub Profile
#!/bin/bash
###
### my-script — does one thing well
###
### Usage:
### my-script <input> <output>
###
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
@SpencerCDixon
SpencerCDixon / tuple-install.sh
Created February 26, 2019 18:31
Install Tuple
curl -L https://git.io/tuple-install | bash
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
# For updates, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#########################
@SpencerCDixon
SpencerCDixon / adv2notes.md
Created February 8, 2018 15:41 — forked from nicholasknight/adv2notes.md
Kinesis Advantage 2 notes

(NOTE: Current and future versions of this and any other Advantage 2-related things I post will be at https://github.com/nicholasknight/adv2keyboard)

I received my Advantage 2 today. There's no full manual yet, even though keyboards are apparently arriving (hint, hint, Kinesis). The quick start guide leaves out the "power user mode", and there are some other quirks.

Update: A manual has been posted at http://www.kinesis-ergo.com/advantage2-resources/

It includes a dictionary for the key maps, but I know it leaves at least one possible key undocumented: it does not list f14, but I have successfully mapped my scrollock to f14 regardless.

It also mentions a firmware version (1.0.18) that doesn't seem to be available yet, with a new feature (status report playback speed).

@SpencerCDixon
SpencerCDixon / slim-redux.js
Created June 23, 2016 17:19 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
use strict;
use warnings;
# imports 'shuffle' on global scope, alternatively I could use List::Util::shuffle when I need it
use List::Util ("shuffle", "reduce");
use Data::Dumper; # Useful for debugging 'print Dumper \@array';
=pod
This is an attempt at implementing a super simple version of BlackJack
in order to learn Perl syntax and the athena coding conventions.
@SpencerCDixon
SpencerCDixon / javascript.snippets
Last active March 9, 2020 14:27
React ES6 Vim Snippets
snippet it
it("${1}", function() {
${2}
});
snippet desc
describe("${1}", function() {
${2}
});
snippet con
constructor(props) {
@SpencerCDixon
SpencerCDixon / globo_gym2.md
Created March 26, 2015 17:36
Globo Gym Challenge - Part 2

Globo Gym Challenge - Part 2

Refer back to Globo Gym challenge part 1 for reference

Now that we have spent some time thinking about how we are going to model Globo's new gym application its time to start building it in Rails. In order to get started we will use the make_it_so gem in order to get user authentication for free. make_it_so rails globo_gym to get the rails app going

The first feature we will build is the ability to create new gym locations. Here are the different fields we will want on a gym location:

  • name
  • street
@SpencerCDixon
SpencerCDixon / gym_memberships.md
Last active August 29, 2015 14:17
Active Record Associations

Active Record Associations

Globo Gym Challenge

After graduating Launch Academy you get a job working for Globo Gym. They want you to build a light-weight, lean, and agile Sinatra application to handle all their memberships. White Goodman understands the importance of using an ORM to model your data and he has concluded that Active Record is the most badass one around. Currently, Globo Gym has over 20 locations and is slowly putting the Average Guys gym out of business. (which is probably why they can afford to hire you)

Create the ER Diagram and associations for Globo Gym's new application. There will be multiple gyms using the application and users memberships are only available at one gym. Think about what types of tables you will need to create this application. Think about what different columns you will need in each table.

Extra Credit

@SpencerCDixon
SpencerCDixon / morse.rb
Created November 17, 2014 21:58
Morse Code - Comet Challenge
# Take in morse code and output correct english
require 'pry'
ALPHABET = {
".-"=> "A",
"-..."=> "B",
"-.-."=> "C",
"-.."=> "D",
"."=> "E",
"..-."=> "F",