Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / 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 / 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 / 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",
@kingcons
kingcons / hangman.rb
Created March 22, 2016 23:55
March Crash Course
## Hangman
## Data
# * guesses
# * answer
# * dictionary / word_list
# * body parts? turn count? limit on turns?
# CamelCaseIsLikeThis
require "sinatra/base"
require "json"
require "pry"
module Httpunk
class Api < Sinatra::Base
set :logging, true
get "/api/test" do
content_type :json

closing-time

Description

Use the GitHub API to close an issue from the command line

Objectives

Learning Objectives