Skip to content

Instantly share code, notes, and snippets.

@mitchellh
mitchellh / archive.md
Last active January 17, 2024 11:17
Archive List

Planned Repo Archive

In the new year, I plan on archiving the repositories below. Because I plan on only archiving the repositories, any project that depends on any of these projects will continue to work. However, I will no longer be accepting issues or pull requests and will never tag a new release.

The reality of each of the projects listed below is that I've almost completely ignored issues and pull requests for

@sloanlance
sloanlance / jq_jsonl_conversion.md
Last active May 3, 2024 10:26
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

Prerequisites

  • jqhttps://jqlang.github.io/jq/ — "like sed for JSON data"

    There are several options available for installing jq. I prefer to use Homebrew: brew install jq

  1. JSONL → JSON

@zxaos
zxaos / Cycle Karabiner Elements Profiles.alfredworkflow
Last active June 7, 2017 18:37
Cycle Karabiner-Elements profiles with Alfred

Dockerfile

FROM ruby:2.3.1-alpine

RUN apk --update --no-cache add build-base imagemagick less libxml2-dev libxslt-dev postgresql-dev && mkdir -p /app

WORKDIR /app

COPY Gemfile Gemfile.lock ./
@pointlessone
pointlessone / Readme
Last active October 6, 2015 13:40
Rubocop pre-commit check
# Installation
Put these files in your `.git/hooks` directory and make them executable.
# Changelog
## 1.2
* Check for RuboCop updates
# MODEL
class Case < ActiveRecord::Base
include Eventable
has_many :tasks
concerning :Assignment do
def assign_to(new_owner:, details:)
transaction do
@jed
jed / how-to-set-up-stress-free-ssl-on-os-x.md
Last active February 25, 2024 17:35
How to set up stress-free SSL on an OS X development machine

How to set up stress-free SSL on an OS X development machine

One of the best ways to reduce complexity (read: stress) in web development is to minimize the differences between your development and production environments. After being frustrated by attempts to unify the approach to SSL on my local machine and in production, I searched for a workflow that would make the protocol invisible to me between all environments.

Most workflows make the following compromises:

  • Use HTTPS in production but HTTP locally. This is annoying because it makes the environments inconsistent, and the protocol choices leak up into the stack. For example, your web application needs to understand the underlying protocol when using the secure flag for cookies. If you don't get this right, your HTTP development server won't be able to read the cookies it writes, or worse, your HTTPS production server could pass sensitive cookies over an insecure connection.

  • Use production SSL certificates locally. This is annoying

@robworley
robworley / export_pt_label
Last active October 10, 2015 19:17
export_pt_label
#!/usr/bin/env ruby
gem 'activesupport'
gem 'pivotal-tracker'
require 'active_support/core_ext/string'
require 'pivotal_tracker'
API_TOKEN = "YOUR_API_TOKEN"
PROJECT_ID = "YOUR_PROJECT_ID"
@myobie
myobie / mountain-lion-brew-setup.markdown
Created February 18, 2012 20:14
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from the App Store.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@number5
number5 / array_pop.sql
Created November 25, 2011 03:00
array pop function for postgresql 8.4+
CREATE OR REPLACE FUNCTION array_pop(a anyarray, element character varying)
RETURNS anyarray
LANGUAGE plpgsql
AS $function$
DECLARE
result a%TYPE;
BEGIN
SELECT ARRAY(
SELECT b.e FROM (SELECT unnest(a)) AS b(e) WHERE b.e <> element) INTO result;
RETURN result;