Skip to content

Instantly share code, notes, and snippets.

View lisp-ceo's full-sized avatar
🎯
Focusing

James Meldrum lisp-ceo

🎯
Focusing
View GitHub Profile
@magnetikonline
magnetikonline / README.md
Last active March 10, 2024 20:31
VirtualBox create host-only interface and attach to VMs.
@beesandbombs
beesandbombs / sphereBox.pde
Last active July 30, 2023 09:31
sphere box
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
if (p < 0.5)
return 0.5 * pow(2*p, g);
-- The meta-circular interpreter from section 5 of Reynolds's Definitional
-- Interpreters for Higher Order Programming Languages
-- (http://www.cs.uml.edu/~giam/91.531/Textbooks/definterp.pdf)
data EXP
= CONST Const
| VAR Var
| APPL Appl
| LAMBDA Lambda
| COND Cond
Priority Queues
═══════════════
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
INSERT DEL-MIN MIN DEC-KEY DELETE MERGE
binary log n log n 1 log n log n n
binomial 1 log n 1 log n log n log n
Fibonacci 1 log n† 1 1† log n† log n
Pairing 1† log n† 1† 1† log n† 1†
Brodal-Okasaki 1 log n 1 1 log n 1
@gkbrk
gkbrk / Cargo.toml
Last active March 4, 2019 05:37
Asynchronous server example in Rust
[package]
name = "rust-async-qotd"
version = "0.1.0"
authors = ["Gökberk Yaltıraklı <[email protected]>"]
[dependencies]
tokio = { git = "https://github.com/tokio-rs/tokio" }
rand = "0.3"
@filewalkwithme
filewalkwithme / main.go
Last active February 16, 2024 23:22
Listening multiple ports on golang http servers (using http.Handler)
package main
import (
"net/http"
)
func main() {
go func() {
http.ListenAndServe(":8001", &fooHandler{})
}()
@chandeeland
chandeeland / dump_wineries.sql
Created January 7, 2015 19:07
Dirty SQL Data Migration Technique
--
-- how to populate locations table on db2 from wineries table on db1
--
-- SELECT "INSERT INTO locations( name, website, address, address2, city, state, zip, country, phone, created_at, updated_at, latitude, longitude, email, fax, winery_id ) VALUES (" || name ||", " || website || ", " || address || ", null , null, null, null, null, " || phone || ", " || created_at || ", " || modified_at || ",null, null, " || email || ", " || fax || ", " || winery_id || "); " FROM wineries
SELECT 'INSERT INTO locations( name, winery_id ) VALUES ("' || name || '", "' || winery_id || '"); ' FROM wineries
@lisp-ceo
lisp-ceo / gist:17a6310213dfad19a007
Created December 19, 2014 00:23
params simulation with ActionController::Parameters
params = ActionController::Parameters.new({
item: {
name: 'James',
age: 26,
role: 'God'
}
})
@mikeal
mikeal / gist:6685843
Last active December 23, 2015 19:58
Response to comments by Issac Roth of StrongLoop

This is rather out of date and we've all moved past it. Me and Issac are cool now.

pic

@robfig
robfig / .emacs
Last active June 13, 2023 16:08
Emacs integration with goimports - https://github.com/bradfitz/goimports. Every time you save your Go code, 1. Add missing imports (standard library only), 2. Remove unnecessary imports, 3. Go fmt
;; OSX - Update the PATH to match that from the shell
(defun set-exec-path-from-shell-PATH ()
(let ((path-from-shell
(replace-regexp-in-string "[[:space:]\n]*$" ""
(shell-command-to-string "$SHELL -l -c 'echo $PATH'"))))
(setenv "PATH" path-from-shell)
(setq exec-path (split-string path-from-shell path-separator))))
(when (equal system-type 'darwin) (set-exec-path-from-shell-PATH))
;; Go mode