Skip to content

Instantly share code, notes, and snippets.

@kingcons
kingcons / june.rb
Last active April 24, 2022 16:36
Crash Course 2.0
# require 'pry'
WORDS = ["cookies", "bourbon", "dogs", "sunshine", "vacations",
"dictionaries", "georgia"]
## Pieces of data in Hangman:
# Guesses
# Answer
# Turn Count
@kingcons
kingcons / clones.md
Last active August 12, 2019 04:39
clones quickstart

Installing Clones

May need to brew install libsdl2-dev

brew install sbcl # or apt-get if you nasty playa
curl -O https://beta.quicklisp.org/quicklisp.lisp > quicklisp.lisp
sbcl --load quicklisp.lisp # and follow the prompts
git clone git@github.com:kingcons/clones.git ~/quicklisp/local-projects/clones.git
@kingcons
kingcons / nth-root.lisp
Last active August 8, 2018 20:30
A cute program to compute nth-roots, extracted from SICP exercises
(defun average-damp (fn)
(lambda (x)
(/ (+ x (funcall fn x)) 2)))
(defun compose (f g)
(lambda (x)
(funcall f (funcall g x))))
(defun repeated (fn n)
(labels ((iter (i &optional result)
@kingcons
kingcons / install.md
Last active April 12, 2018 01:40
Install Party!

Computer Setup

Hey y'all. I want to be sure everyone is ready to roll, so here's are a few things I'd like for you to go ahead and install. Please ask if you have any trouble, or just are curious about why something works the way it does.

After each step, I'll leave a note saying how to check that it was installed properly. Please be sure to run these checks! The most common sorts of errors are commands not completing because your user lacks permission.

If that happens, feel free to flag me down and we'll get it fixed up quick! I'll assume things went smoothly unless I hear otherwise.

@kingcons
kingcons / case.lisp
Created January 9, 2018 17:27 — forked from guicho271828/case.lisp
case -> jump table (see fcase8, fcase9)
#!/bin/sh
#|-*- mode:lisp -*-|#
#|
exec ros -Q -- $0 "$@"
|#
(progn ;;init forms
(ros:ensure-asdf)
#+quicklisp (ql:quickload '(:alexandria :trivia :iterate) :silent t))
(defpackage :ros.script.case.3724474528
@kingcons
kingcons / images.js
Last active February 8, 2017 17:38
Desktopography Carousel
var carouselImages = [
{
image_url: 'http://desktopography.net/wp-content/uploads/bfi_thumb/hushed_1920x1200-32f5431dh4se5dwk02ct1c.jpg',
title: 'Hushed',
photographer_id: 'Michael Withers'
},
{
image_url: 'http://desktopography.net/wp-content/uploads/bfi_thumb/dndln_1920x1200-32f56720k59biqi0157i0w.jpg',
title: 'Dndln',
photographer_id: 'Carlos'
@kingcons
kingcons / quiz.md
Last active November 1, 2016 01:53
Quiz 10/15

Section 1 - Top Level Code, Simple Block Usage

ages = [28, 32, 42, 64]
ages.map { |x| x * 2 }
ages.each { |age| puts "Age is: #{age}" }
  1. What is the result of the ages.map call? What about ages.each?
@kingcons
kingcons / test_lib.js
Created July 5, 2016 02:13
ye olde 20 line test lib
let it = function (description, contents) {
console.log('\n\n"It ' + description + '"');
contents();
};
let expect = function (target) {
return {
toBe: function(expectation) {
if (target === expectation) {
console.log('\n %cPASSED', 'color:green;', 'Expected', target, 'to be', expectation);
@kingcons
kingcons / may_crash_course.rb
Created May 11, 2016 00:24
May Crash Course
## Hangman
=begin
Anything that goes in here is just normal text.
Data in Hangman
========
* word list/dictionary (array of strings)
* answer (string)
## Hangman
## Data
# * answer
# * guesses
# * maximum number of wrong guesses
# * word_list / dictionary
WORD_LIST = [
"buffalo", "laptop", "programming", "gambino",