Skip to content

Instantly share code, notes, and snippets.

View yoshuawuyts's full-sized avatar

Yosh yoshuawuyts

View GitHub Profile
# add this to your .zshrc and then add
# $(__prompt_color) to your PROMPT
function __prompt_color()
{
local RGB CONVERTED RH GH BH RD GD BD
RGB=$(echo $(pwd) | md5 | cut -c 1-6)
RH=$(echo ${RGB} | cut -c 1-2)
GH=$(echo ${RGB} | cut -c 3-4)
@yoshuawuyts
yoshuawuyts / _readme.md
Last active August 29, 2015 14:13 — forked from mislav/_readme.md

I use tmux splits (panes). Inside one of these panes there's a Vim process, and it has its own splits (windows).

In Vim I have key bindings C-h/j/k/l set to switch windows in the given direction. (Vim default mappings for windows switching are the same, but prefixed with C-W.) I'd like to use the same keystrokes for switching tmux panes.

An extra goal that I've solved with a dirty hack is to toggle between last active panes with C-\.

Here's how it should work:

@yoshuawuyts
yoshuawuyts / README.md
Last active August 29, 2015 14:15 — forked from andyshinn/README.md

Terraform, CoreOS, and Digital Ocean

Let's use Terraform to easily get a CoreOS cluster up on Digital Ocean. In this example we will get a 5 node CoreOS cluster up and running on the Digital Ocean 8GB size.

Install Terraform

Grab a copy of Terraform for your platform from http://www.terraform.io/downloads.html. Follow the instructions at http://www.terraform.io/intro/getting-started/install.html by getting Terraform in your PATH and testing that it works.

Digital Ocean API Key

@yoshuawuyts
yoshuawuyts / modules.md
Last active August 29, 2015 14:15 — forked from mattdesl/modules.md
// stepper.js
// 2015 cloudbender
// iojs 1.0.2
// generator works and steps itself,
// from the event loop;
process.on( 'exit', function(){console.log('bye');} );
(function main(){
@yoshuawuyts
yoshuawuyts / wercker.yml
Last active August 29, 2015 14:16 — forked from eddie/wercker.yml
box: wercker/nodejs
# Build definition
build:
# The steps that will be executed on build
steps:
- script:
name: Reduce NPM cache time
code: npm config set cache-lock-stale 10000
{ config, pkgs, ... }:
let
hostname = "luz3";
in {
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
# I use VirtualBox to connect to Windows and Linux guests
@yoshuawuyts
yoshuawuyts / cliclock.sh
Last active August 29, 2015 14:16 — forked from Goles/cliclock.sh
#!/bin/sh
# Command-line world clock
# Taken from http://stackoverflow.com/questions/370075/command-line-world-clock
# .worldclock.zones file looks like:
# US/Pacific
# Europe/Berlin
# Chile/Continental
: ${WORLDCLOCK_ZONES:=$HOME/.worldclock.zones}
@yoshuawuyts
yoshuawuyts / _.md
Last active August 29, 2015 14:17 — forked from klange/_.md

Since this is on Hacker News...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later).
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • They're all while loops because shut up, you're overthinking a joke.
@yoshuawuyts
yoshuawuyts / taskgit
Last active August 29, 2015 14:18 — forked from unode/taskgit
#!/bin/sh
# copyright 2014 Renato Alves
# distributed under the GPL licence
if [ -z "$TASKDIR" ]; then
#TODO Look for data location in rc:location instead of assuming ~/.taskrc
TASKDIR="$(grep data.location $HOME/.taskrc | cut -d '=' -f 2)"
fi