Skip to content

Instantly share code, notes, and snippets.

@battermann
battermann / free.fsx
Last active February 17, 2022 23:26
Free Monad like pattern in F#
#load @"paket-files/fsprojects/Chessie/src/Chessie/ErrorHandling.fs"
type Continuation<'output, 'next> = 'output -> 'next
module TerminalDsl =
open Chessie.ErrorHandling
type Terminal<'next> =
| WriteLine of string * Continuation<unit, 'next>
| ReadLine of unit * Continuation<string, 'next>
@higepon
higepon / API.swift
Last active July 31, 2023 16:00
An example of JSON API call in Swift
//
// API.swift
//
// Created by Taro Minowa on 6/10/14.
// Copyright (c) 2014 Higepon Taro Minowa. All rights reserved.
//
import Foundation
typealias JSONDictionary = Dictionary<String, AnyObject>
@jbenet
jbenet / simple-git-branching-model.md
Last active June 14, 2024 17:16
a simple git branching model

a simple git branching model (written in 2013)

This is a very simple git workflow. It (and variants) is in use by many people. I settled on it after using it very effectively at Athena. GitHub does something similar; Zach Holman mentioned it in this talk.

Update: Woah, thanks for all the attention. Didn't expect this simple rant to get popular.

@fnando
fnando / Vagrantfile
Created April 18, 2013 12:06
My current Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.box = "hellobits"
config.vm.synced_folder ".", "/Projects", id: "vagrant-root"
forward_port = ->(guest, host = guest) do
config.vm.network :forwarded_port,
guest: guest,
@philsturgeon
philsturgeon / default.rb
Created January 8, 2013 18:02
Get PHP 5.4 in Ubuntu 12.04 (or just upgrade to 12.10)
# Use PHP 5.4
apt_repository "php54" do
uri "http://ppa.launchpad.net/ondrej/php5/ubuntu"
distribution node['lsb']['codename']
components ["main"]
keyserver "keyserver.ubuntu.com"
key "E5267A6C"
end
@jtimberman
jtimberman / rename-node.rb
Created March 2, 2012 07:47 — forked from mpasternacki/rename-node.rb
A knife exec script to change Chef node's name.
#!./bin/knife exec
# A knife exec script to change chef node's name, preserving all the attributes.
#
# Usage: knife exec rename-node.rb old-name new-name
#
# Script retrieves the Node object, changes its 'name' attribute,
# creates new Node object with updated name and rest of attributes
# untouched. Then it deletes old Node and Client objects from
# database, and logs into the server to update it:
@mattweber
mattweber / README.txt
Created March 1, 2012 04:09
ElasticSearch Multi-Select Faceting Example
This is an example how to perform multi-select faceting in ElasticSearch.
Selecting multiple values from the same facet will result in an OR filter between each of the values:
(facet1.value1 OR facet1.value2)
Faceting on more than one facet will result in an AND filter between each facet:
(facet1.value1 OR facet1.value2) AND (facet2.value1)
I have chosen to update the counts for each facet the selected value DOES NOT belong to since we are performing an AND between each facet. I have included an example that shows how to keep the counts if you don't want to do this (filter0.sh).
@dsyph3r
dsyph3r / apache_virtual_host.txt
Created April 3, 2011 18:10
Symfony 2: Click
<VirtualHost 127.0.0.1:80>
ServerName click.dev
DocumentRoot "/var/www/html/click.dev/web"
DirectoryIndex app.php
<Directory "/var/www/html/click.dev/web">
AllowOverride All
Allow from All
</Directory>
</VirtualHost>