Skip to content

Instantly share code, notes, and snippets.

@alandipert
alandipert / midi.clj
Created March 31, 2010 12:37
Play music with Clojure and javax.sound.midi
(import '(javax.sound.midi MidiSystem Synthesizer))
(defn play-note [synth channel note-map]
(let [{:keys [note velocity duration]
:or {note 60
velocity 127
duration 1000}} note-map]
(. channel noteOn note velocity)
(Thread/sleep duration)
(. channel noteOff note)))
@ryin
ryin / tmux_local_install.sh
Last active April 23, 2024 01:06
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8
@piscisaureus
piscisaureus / pr.md
Created August 13, 2012 16:12
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@dergachev
dergachev / README.md
Created October 10, 2012 16:49
Vagrant tutorial

Vagrant Setup

This tutorial guides you through creating your first Vagrant project.

We start with a generic Ubuntu VM, and use the Chef provisioning tool to:

  • install packages for vim, git
  • create user accounts, as specified in included JSON config files
  • install specified user dotfiles (.bashrc, .vimrc, etc) from a git repository

Afterwards, we'll see how easy it is to package our newly provisioned VM

@quisquous
quisquous / gist:5167417
Last active December 14, 2015 23:39
How not to be scary (when teaching programming)
How not to be scary (when introducing programming)
A transcribed lightning talk given by Lyla Fischer at the PyCon 2013 Education Summit
What are people scared of? The main thing that people are scared of is that
they don't belong. The rest of my talk is mainly going to center on this one
point.
I'm going to let you take 15 seconds to think of stereotypes of programmers.
@huonw
huonw / gist:5553335
Last active December 17, 2015 04:49
Rust > C[lang] for Mersenne Twister

This is wrong, Rust is not faster than GCC (but is sometimes faster than Clang), see this discussion

I implemented the Mersenne Twister random number generator in Rust, and then compared the Rust one with the fastest non-Rust one I could find (mt19937ar-cok.c on this page):

** Rust **
1040076681

real    0m4.470s
user 0m4.444s
@flohdot
flohdot / productivity and self-management
Last active November 2, 2023 01:02
tools for freelancers
Trello: http://trello.com
Fantastic, simple project management. Free tier does most things you'll ever need. I've tried Basecamp, Unfuddle and a million bug trackers, but a combination of Github and Trello is what I like best. Trello gives you a nice full overview of your whole project and who is doing what. It also makes it really easy to reorganize priorities. Unless my client has a project management tool they want me to use, I create a Trello board and add the client and try to centralize as much communication as possible in there.
Toggl: http://toggl.com
Best time-tracking app I've tried, with native apps for just about every OS. Free tier does most things you'll ever need. Paid tier does even more and plugs into various other tools.
@jvns
jvns / interview-questions.md
Last active March 5, 2024 19:03
A list of questions you could ask while interviewing

A lot of these are outright stolen from Edward O'Campo-Gooding's list of questions. I really like his list.

I'm having some trouble paring this down to a manageable list of questions -- I realistically want to know all of these things before starting to work at a company, but it's a lot to ask all at once. My current game plan is to pick 6 before an interview and ask those.

I'd love comments and suggestions about any of these.

I've found questions like "do you have smart people? Can I learn a lot at your company?" to be basically totally useless -- everybody will say "yeah, definitely!" and it's hard to learn anything from them. So I'm trying to make all of these questions pretty concrete -- if a team doesn't have an issue tracker, they don't have an issue tracker.

I'm also mostly not asking about principles, but the way things are -- not "do you think code review is important?", but "Does all code get reviewed?".

@dmccombs
dmccombs / config.fish
Created April 28, 2016 00:59
A simple way to use the GNOME keyring for SSH key managment in fish shell
# Add this to the bottom of your config.fish file
# Set SSH to use Gnome keyring
set -gx SSH_AUTH_SOCK (gnome-keyring-daemon --start | grep "^SSH_AUTH_SOCK" | awk -F "=" '{print $2}')