Skip to content

Instantly share code, notes, and snippets.

ad8e / glfw_ship.cpp
Last active May 21, 2024 03:10
instructions to use skia and glfw together. (download, installation, first program). as of Sept 2023, Windows is broken but this is still sadly the best starting resource for skia on Windows too.
/* Note: this Google copyright notice only applies to the original file, which has large sections copy-pasted here. my changes are under CC0 (public domain).
* Copyright 2015 Google Inc.
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
The official instructions don't work well. These alternative instructions are intended to be the shortest path to get a minimal setup running.

CoreOS Workstation Notes

This is a summary of the system setup used for the demonstration on 2016-07-18.

Goals / Requirements

This was put together with the following intent:

  • It must build upon an unmodified CoreOS user space image.
Jarred-Sumner / comcast.js
Last active September 7, 2022 01:30
Comcast injects this into webpages to show copyright notices
// Comcast Cable Communications, LLC Proprietary. Copyright 2014.
// Intended use is to display browser notifications for critical and time sensitive events.
var _ComcastAlert = (function(){
return {
SYS_URL: '/e8f6b078-0f35-11de-85c5-efc5ef23aa1f/aupm/'
, dragObj: {zIndex: 999999}
, browser: null
, comcastCheck: 1
, comcastTimer: null
, xmlhttp: null
gaearon / slim-redux.js
Last active May 5, 2024 15:14
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {

Things that programmers don't know but should

(A book that I might eventually write!)

Gary Bernhardt

I imagine each of these chapters being about 2,000 words, making the whole book about the size of a small novel. For comparison, articles in large papers like the New York Times average about 1,200 words. Each topic gets whatever level of detail I can fit into that space. For simple topics, that's a lot of space: I can probably walk through a very basic, but working, implementation of the IP protocol.

This is an example of how to use Hypothesis to test a classic combinatorial
optimisation problem without having a reference implementation to compare
The problem we're going to look at is the knapsack packing problem: Given a
set of objects with value and weight, how can maximize the total value while
keeping the total weight under a certain amount.
You can solve this exactly as an integer linear programming without too much
thypon / Extract Deps
Created April 24, 2015 23:56
Extract Deps in Ruby
#!/usr/bin/env ruby
require 'rubygems'
require 'gems'
require 'json'
class Package <, :language, :version, :hash, :source, :homepage, :depends)
class Dependencies <, :make, :runtime)
romainl /
Last active August 12, 2021 21:56
RNB, a Vim colorscheme template
ryane / five_minutes.yml
Created February 24, 2015 15:15
- hosts: all
ubuntu_common_deploy_user_name: deploy
- ~/.ssh/
mislav /
Created January 20, 2015 01:47
Fuzzy scoring algorithm adopted from Selecta as used on
# Get the shortest match (least distance between start and end index) for all
# the query characters in the given text.
# Returns an array in format [firstIndex, matchLength, [matchIndexes]]
shortestMatch = (text, queryChars) ->
starts = allIndexesOf(text, queryChars[0])
return if starts.length is 0
return [starts[0], 1, []] if queryChars.length is 1