Skip to content

Instantly share code, notes, and snippets.

@ghadishayban
ghadishayban / vendor_asm.sh
Created February 12, 2018 01:46
a script that vendors asm and writes itself as git commit 'transaction data'
#!/bin/bash
# author Ghadi Shayban <gshayban@gmail.com>
set -e
if [ -z ${1+x} ]
then
echo provide an asm git sha / ref
exit 1
fi
@darconeous
darconeous / kidde-interconnect.md
Last active April 1, 2024 03:02
kidde-interconnect

Original "dumb" smoke detector interconnect sounds the siren on all interconnected smoke detectors when a 9-to-12 volt (referenced to neutral/white) direct-current signal is continuously present on the signal wire (red). This still how pretty much all interconnected smoke alarms indicate a fire condition.

However, modern interconnected detectors are capable of detecting carbon monoxide and other conditions. When these conditions are signaled, they must be identified as something other than a smoke alarm by the other detectors. Ideally, any dumb smoke detectors

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

(ns demo.core
(:require [clojure.core.typed :as t]))
;; Map vs Vector AST representation
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; * Maps
(t/defalias M (t/U '{:op ':if :test M :then M :else M}
'{:op ':do :e1 M :e2 M}
@reborg
reborg / clojure-irc-pdf-links
Last active July 16, 2017 15:18
PDF Links #Clojure IRC
@bitemyapp
bitemyapp / gist:8739525
Last active May 7, 2021 23:22
Learning Haskell
@hiredman
hiredman / scratch.clj
Created August 12, 2013 20:10
capture class bytes
(def classbytes (atom {}))
(defn bytes-of-forms [form]
(push-thread-bindings
{clojure.lang.Compiler/LOADER
(proxy [clojure.lang.DynamicClassLoader] [@clojure.lang.Compiler/LOADER]
(defineClass
([name bytes src]
(swap! classbytes assoc name bytes)
@mbland
mbland / README.md
Created October 1, 2012 14:51 — forked from JanDupal/README.md
Quick'n'dirty Jekyll plugin for sorted cycle

Jekyll sorted_for plugin

Quick'n'dirty Jekyll plugin for sorted cycle.

Install

Copy sorted_for.rb to _plugins/ directory of your Jekyll site.

Usage

@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this: