Skip to content

Instantly share code, notes, and snippets.

@Bouke
Bouke / gist:11261620
Last active March 4, 2025 11:36
Multiple Python installations on OS X

Previous versions used homebrew to install the various versions. As suggested in the comments, it's better to use pyenv instead. If you are looking for the previous version of this document, see the revision history.

$ brew update
$ brew install pyenv
$ pyenv install 3.5.0
$ pyenv install 3.4.3
$ pyenv install 3.3.6
$ pyenv install 3.2.6
$ pyenv install 2.7.10

$ pyenv install 2.6.9

@nickjacob
nickjacob / systemd-prblm.service
Last active March 17, 2023 16:11
execute arbitrary bash code/variable substitution in systemd units
[Unit]
Description=Demonstrate Bash
[Service]
ExecStartPre=/usr/bin/bash -c "/usr/bin/systemctl set-environment MYVAR=$(( 2 + 2 ))"
ExecStart=/usr/bin/echo "2 + 2 = ${MYVAR}"
@cupakromer
cupakromer / flatten_map_bm.rb
Last active August 29, 2015 13:56
If you may have an array of arrays, `flat_map` is probably the way to go
require "benchmark"
require "benchmark/ips"
def arr
Array.new(1_000, 1)
end
def arr_of_arrs
Array.new(1_000){ (1..1000).to_a }
end
@stuarthalloway
stuarthalloway / schema_history.clj
Last active March 31, 2017 21:40
Complete schema history of a live Datomic database
;; Complete schema history for a live Datomic database.
(require
'[clojure.pprint :as pp]
'[clojure.set :as set]
'[datomic.api :as d])
;; fill this in with your own database connection
(def uri "datomic:dev://localhost:4334/my-db")
(def conn (d/connect uri))
(def db (d/db conn))
#!/usr/bin/env ruby
input = "%clipboard"
subs = {
" " => " ",
"a" => "ɐ",
"b" => "q",
"c" => "ɔ",
"d" => "p",
"e" => "ǝ",
@ungoldman
ungoldman / dokku_setup.md
Last active November 28, 2023 12:35
Deploy your own PaaS: Setting up Dokku with DigitalOcean and Namecheap

Deploy your own PaaS!

Setting up Dokku with DigitalOcean and Namecheap

..or how I made my own heroku in a few hours for $3.98.


This write-up is several years out of date! You probably shouldn't use it.

@bokmann
bokmann / triangle_peg.rb
Last active June 14, 2016 18:57
An example from "What Computer Scientists Know: Thinking Recursively, Part 2. In this example we are going to explore how we use our newfound knowledge of recursion to search through all the solutions of a simple puzzle using recursive backtracking.
# This is a programming chellenge from David Bock's series
# "What Computer Scientists Know". This is a problem that can
# be used to discuss a bunch of computer science topics, but
# as I'm providing most of the skeleton of the solution, the
# point of this exercise is to demonstrate 'recursive backtracking'.
# http://en.wikipedia.org/wiki/Backtracking
# this problem is based on the classic 'triange peg game', a common
# sight in roadside diners in America, in particular, Cracker
@csexton
csexton / irc-cheat-sheet.md
Last active December 25, 2015 07:49
IRC Cheat Sheet for #arlingtonruby

So you can be an op, you need to register, you can do that by running this command:

/msg nickserv register your_password your_email_address

To become an operator on #arlingtonruby:

/msg chanserv op #arlingtonruby

To make someone an op:

@csexton
csexton / coder-night.md
Created September 30, 2013 15:26
Arlington Ruby Coder Night

Draft for Arlington Ruby. Adapted from Tampa Ruby. And by "adapted," I mean "stolen."


tl;dr - CoderNight is to practice development. You write code in pairs or individually and submit the code to me. I post an anonymized repo and you have a week to look at all the solutions before a friendly night of code review.

NOTE: Please email me or ask in the IRC channel: #arlingtonruby on freenode if you have questions.

THIS MONTH'S PROBLEM SET: http://puzzlenode.com/puzzles/11-hitting-rock-bottom

@elefontpress
elefontpress / gist:6159651
Last active June 12, 2024 22:48
This is the contract Bearded uses for client work on a time and materials basis. It's worked for us, but I am not a lawyer, so please run it by yours before you use it! Regardless, do whatever you like with it. Use it, share it, change it ... go nuts. Our original contract from 2008 was for fixed-price projects and was based on Andy Clark'e Cont…

Bearded's Hourly Contract

Date: [[Date of Document]] Between [Our Company] and [Your Company]

Summary

We’re not big on formality, but sometimes it’s best to have a few simple things written down so that we’re all on the same page. In this contract you won’t find complicated legal terms or large passages of unreadable text. We have no desire to trick you into signing something that you might later regret. We do want what’s best for the safety of both parties, now and in the future.