Skip to content

Instantly share code, notes, and snippets.

View tildedave's full-sized avatar
🌮
Hungry

Dave King tildedave

🌮
Hungry
View GitHub Profile
@ekmett
ekmett / monads for plt-racket
Created June 26, 2010 05:06
Monads for PLT Racket
(module monad scheme
(require "curry.ss")
;; i'm too lazy to repeat this pattern for now.
(define-syntax init-public
(syntax-rules ()
((_) (begin))
((_ (m default) ms ...) (begin
(init-field (m default))
(public (internal-m m))
(define (internal-m . rest) (apply (get-field m this) rest))
@stevendanna
stevendanna / default.rb
Created October 11, 2011 16:33
Monkey patching the Template resource to do validation
#
# Cookbook Name:: template_checker
# Recipe:: default
#
# Copyright 2011, Opscode, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@jordansissel
jordansissel / logstash-mysql-query-parse.md
Last active June 7, 2021 21:10
parsing mysql's query log format with logstash

parsing mysql query logs with logstash

The problem is that some lines in the file are missing timestamps when they aren't continuations of any previous line. It's dumb, really.

The mysql query log is seriously bullshit format, but nothing logstash can't unscrew.

The main goal here is to show how we can fix the 'missing timestamp' problem.

% ruby bin/logstash agent -e '

argparse==1.2.1
demjson==1.6
ipaddress==1.0.1
mock==0.8.0
pygooglechart==0.3.0
certifi==0.0.8 # Unable to determine the version, using latest
cloudkick==0.1.0-dev # extern: "cloudkick_api"
coverage==3.5.1
datadiff==1.1.3
python-dateutil==1.5 # extern: "dateutil"
@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.
*/
@amussey
amussey / .gitignore
Last active December 24, 2015 16:19
Cassandra Scripts
cassandra_config.py
*.pyc
project/
@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);
}
/** @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">
@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

@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