Skip to content

Instantly share code, notes, and snippets.

View tildedave's full-sized avatar
🌮
Hungry

Dave King tildedave

🌮
Hungry
View GitHub Profile
@davidad
davidad / primes_infinite.v
Last active June 25, 2019 13:45
Coq formalization of the infinitude of primes
Require Import Arith Decidable Euclid Psatz Wf_nat.
Definition divides a b := exists k, b = k * a.
Definition prime p := 2 <= p /\ forall k, divides k p -> (k = 1 \/ k = p).
Lemma dec_divides k n: decidable (divides k n).
Proof with intuition.
case (le_gt_dec k 0)...
- case (le_gt_dec n 0).
+ left; exists 0...
@peterellisjones
peterellisjones / Chess Perft test positions
Last active September 20, 2024 17:02
Test positions for debugging chess engines. Formatted as JSON array of FEN strings
[
{
"depth":1,
"nodes":8,
"fen":"r6r/1b2k1bq/8/8/7B/8/8/R3K2R b KQ - 3 2"
},
{
"depth":1,
"nodes":8,
"fen":"8/8/8/2k5/2pP4/8/B7/4K3 b - d3 0 3"
@jar-o
jar-o / DBIxOut.pm
Last active January 9, 2017 05:03
Want to see the trace leading up to the sql output? Here you go.
=pod
Put this is in the module in which you want to see SQL:
use DBIxOut;
my $dbout = DBIxOut->new();
$dbout->enable_from_rs($resultset);
# OR
@asterick
asterick / grid.scss
Last active June 12, 2018 07:05
Variable column grid system with ratios ala PURE in very little SCSS
// Globals
$screen-width: 1280px;
// Grid
$column-granularity: 12;
$column-gutter: 20px;
// Dimensions (responsive)
$screen-xs-max: 567px;
$screen-sm-min: 568px;
@jashkenas
jashkenas / semantic-pedantic.md
Last active September 5, 2024 17:03
Why Semantic Versioning Isn't

Spurred by recent events (https://news.ycombinator.com/item?id=8244700), this is a quick set of jotted-down thoughts about the state of "Semantic" Versioning, and why we should be fighting the good fight against it.

For a long time in the history of software, version numbers indicated the relative progress and change in a given piece of software. A major release (1.x.x) was major, a minor release (x.1.x) was minor, and a patch release was just a small patch. You could evaluate a given piece of software by name + version, and get a feeling for how far away version 2.0.1 was from version 2.8.0.

But Semantic Versioning (henceforth, SemVer), as specified at http://semver.org/, changes this to prioritize a mechanistic understanding of a codebase over a human one. Any "breaking" change to the software must be accompanied with a new major version number. It's alright for robots, but bad for us.

SemVer tries to compress a huge amount of information — the nature of the change, the percentage of users that wil

@john2x
john2x / 00_destructuring.md
Last active August 23, 2024 07:45
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

/** @jsx React.DOM */
var React = require("react");
var Lightbox = React.createClass({
render: function() {
return (
<div>
<div className="lightbox-bg"></div>
<div className="lightbox">
<div className="lightbox-wrap">
@amitsaxena
amitsaxena / gist:8601424
Last active October 18, 2019 21:51
CustomURL: Launch app if app is installed, else open an alternate URL (iOS all browsers)
<script type="text/javascript">
var timer;
var heartbeat;
var lastInterval;
function clearTimers() {
clearTimeout(timer);
clearTimeout(heartbeat);
}
@amussey
amussey / .gitignore
Last active December 24, 2015 16:19
Cassandra Scripts
cassandra_config.py
*.pyc
project/
@jordwalke
jordwalke / gist:6350319
Last active September 10, 2016 16:27
ReactJS: JavaScript just like you've always done it.
/**
* ReactJS: JavaScript like you've always done it.
*
* This example renders your top ten most followed friends/followers, `filter`ing
* only your favorites, and putting a star on all verified accounts.
*
* With ReactJS, any time your data changes, the UI is always brought up to date
* automatically. If friends length changes, or followCount - it always shows what
* `render` describes.
*/