Skip to content

Instantly share code, notes, and snippets.

-- inspired by: https://groups.google.com/d/msg/elm-discuss/2LxEUVe0UBo/ZgJ_ldUH6ygJ
-- thanks for the help: http://learnyouahaskell.com/functors-applicative-functors-and-monoids
module UserDecoder where
import Date exposing (Date)
import User exposing (User)
import Json.Decode as Js exposing ((:=))
-- Applicative's `pure`:
@dch
dch / free-mbp.md
Last active September 22, 2016 01:24
FreeBSD-11.0-CURRENT with zfs boot on a UEFI-based Apple MacBook Pro early 2011 15" 8 core 2GHz i7

Intro

The goal is to be able to share OSX and FreeBSD while we nut out all the tricky pieces, and use the zpool that FreeBSD boots from, in OSX as our main working storage.

You'll need an MBP with dual drives, in my case, SSDs. This will almost certainly work with a single drive, but the partitioning is a wee bit complicated.

@mislav
mislav / backfill-releases.sh
Created February 5, 2014 17:37
Script to migrate releases from CHANGELOG.md to GitHub Releases
#!/bin/bash
# Usage: OAUTH_TOKEN="..." backfill-releases CHANGELOG.md [<project-title>]
set -e
log="${1?}"
project_name="${2}"
repo="$(git config remote.origin.url | grep -oE 'github\.com[/:][^/]+/[^/]+' | sed 's/\.git$//' | cut -d/ -f2-3)"
[ -n "${project_name}" ] || project_name="${repo#*/}"
.flat {
background-image: none;
box-shadow: none;
border: none;
text-shadow: none;
opacity: .8;
}
@atmos
atmos / heaven.md
Last active November 23, 2020 22:35
Response to a dude who asked about heaven. https://github.com/holman/feedback/issues/422

@holman got a request about our deployment system, heaven

I know it's not a high priority, but has there been any activity on open-sourcing the core Heaven gem?

There is. I've been working on extracting the non-GitHub specific parts into two gems. This first is a CLI portion called hades. The second is an HTTP API portion called heaven.

When you open source something previously used as in internal tool like Heaven, Hubot, Boxen, etc., how do you manage and hook in the parts that need to stay internal?

Normally I focus around four questions:

@jpetazzo
jpetazzo / README.md
Last active December 22, 2015 08:30
Securing Docker with socat and certificates
@stuartsierra
stuartsierra / fresh-chrome.sh
Last active October 13, 2020 16:07
Launch new instances of Google Chrome on OS X with isolated cache, cookies, and user config
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@jasonrudolph
jasonrudolph / 00-about-search-api-examples.md
Last active April 30, 2024 19:21
5 entertaining things you can find with the GitHub Search API
@bkeepers
bkeepers / gist:6002211
Last active December 19, 2015 18:58
I'm looking for a better pattern for defining a method that takes a single object or an array of objects as an argument, does something with them, and then returns either a single object or an Array depending on what was passed to it.
def dress(dog_or_dogs)
dressed_dogs = Array(dog_or_dogs).map {|dog| DogSweater.new(dog) }
dog_or_dogs.respond_to?(:each) ? dressed_dogs : dressed_dogs.first
end
one_dog = dress(Dog.new)
all_my_dogs = dress([Dog.new, Dog.new, Dog.new])
@robmathers
robmathers / readinglisturls.py
Last active November 16, 2023 21:18
Prints out URLs of items in Safari’s Reading List
#!/usr/bin/env python
import plistlib
from shutil import copy
import subprocess
import os
from tempfile import gettempdir
import sys
import atexit
BOOKMARKS_PLIST = '~/Library/Safari/Bookmarks.plist'