Skip to content

Instantly share code, notes, and snippets.

View cndreisbach's full-sized avatar
🍕
eatin' pizza

Clinton N. Dreisbach cndreisbach

🍕
eatin' pizza
View GitHub Profile
@cndreisbach
cndreisbach / compareNumeric.js
Last active July 11, 2019 17:09
JavaScript examples
function compareNumeric(a, b) {
if (a > b) return 1;
if (a == b) return 0;
if (a < b) return -1;
}
let arr = [ 2, 1, 15 ];
arr.sort(compareNumeric);

Setting up your Mac for development

Getting your tools right is an important step in becoming a developer. This guide will walk you through every step you need to take.

There are multiple options that can be used when setting up your computer. This guide is opinionated about those options. Our guidelines are:

  • When possible, use what you already have instead of installing something new.
  • Use the most common development tool unless it is deficient.
  • Less setup is better.
Verifying my Blockstack ID is secured with the address 1Lf1AViZaQ2qPHVjHtbGhseFW1AJW7iPnN https://explorer.blockstack.org/address/1Lf1AViZaQ2qPHVjHtbGhseFW1AJW7iPnN
#!/usr/bin/env python3
"""
Game of Sticks is based on an assignment from Stanford's Nifty Assignments.
http://nifty.stanford.edu/2014/laaksonen-vihavainen-game-of-sticks/handout.html
"""
import random
from collections import Counter
from math import gcd
class Car:
acceleration = 2
braking = 3
desired_speed = 30 # mps = 108 km/hr
minimum_spacing = 15
slowing_prob = 0.2
def __init__(self, speed=0, location=0):
self.speed = speed
self.location = location
@cndreisbach
cndreisbach / HOWTO.md
Last active August 29, 2015 14:08
How to Be An Introvert and Still Have a Great Career

People tell me that in order to get a job, you have to network. There is nothing I would like to do less than talk to strangers about myself, so that's not been an option for me. Here's my tips to having a good career.

Take risky jobs.

Often, we look at job listings and choose something that matches our skills, our interests, and our salary requirements.

If you keep doing those jobs, you'll steadily grow your salary -- maybe -- but it will plateau eventually. Anecdotally, I've seen a plateau at age 40 or at around $150K, whichever comes first. $150K sounds like a lot when you don't have kids and are single or have a partner that also works. It isn't when you're supporting two or three other people.

You'll stay in your interests, but you'll continue to do the same thing for years and years until you are bored to tears, if you're like me.

@cndreisbach
cndreisbach / burger_feed.rb
Created August 15, 2014 01:38
burger-feed
require "rubygems"
require "bundler/setup"
require 'google_spreadsheet'
require 'sinatra'
require 'atom'
require 'rss/maker'
class Burger
attr_reader :name, :score, :link, :cows
@cndreisbach
cndreisbach / keybase.md
Created February 26, 2014 21:25
keybase.md

Keybase proof

I hereby claim:

  • I am cndreisbach on github.
  • I am cndreisbach (https://keybase.io/cndreisbach) on keybase.
  • I have a public key whose fingerprint is DF23 53D2 60A3 9410 AC62 9931 68A5 AEAD 4863 E401

To claim this, I am signing this object:

@cndreisbach
cndreisbach / maze.rkt
Last active December 19, 2015 14:29
Our Maze Jam from Lambda Jam 2013
#lang racket
(require json)
(define (get-maze-cell maze x y)
(list-ref
(list-ref maze y)
x))
(define (neighbors x y)
(list (list x (sub1 y))
(ns monger.key-compression)
(def select (comp first filter))
(defn- trie-add
[trie words]
(reduce
(fn [trie word]
(assoc-in trie (concat word [::val]) word))
trie