Full explanatory article on my site.
A Pen by Dudley Storey on CodePen.
| # On slow systems, checking the cached .zcompdump file to see if it must be | |
| # regenerated adds a noticable delay to zsh startup. This little hack restricts | |
| # it to once a day. It should be pasted into your own completion file. | |
| # | |
| # The globbing is a little complicated here: | |
| # - '#q' is an explicit glob qualifier that makes globbing work within zsh's [[ ]] construct. | |
| # - 'N' makes the glob pattern evaluate to nothing when it doesn't match (rather than throw a globbing error) | |
| # - '.' matches "regular files" | |
| # - 'mh+24' matches files (or directories or whatever) that are older than 24 hours. | |
| autoload -Uz compinit |
| /** | |
| * Fancy ID generator that creates 20-character string identifiers with the following properties: | |
| * | |
| * 1. They're based on timestamp so that they sort *after* any existing ids. | |
| * 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
| * 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
| * 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
| * latter ones will sort after the former ones. We do this by using the previous random bits | |
| * but "incrementing" them by 1 (only in the case of a timestamp collision). | |
| */ |
| Install s3fs on Mac OS X | |
| 1 - Install Homebrew - http://brew.sh/ | |
| ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" | |
| 2 - Use Homebrew to install s3fs + dependencies | |
| brew install s3fs | |
| 3 - Do some custom stuff. I only used the first step from here -> https://gist.github.com/fukayatsu/3910097 | |
| sudo /bin/cp -rfX /usr/local/Cellar/fuse4x-kext/0.9.2/Library/Extensions/fuse4x.kext /Library/Extensions |
| package main | |
| import ( | |
| "fmt" | |
| "io" | |
| "net/http" | |
| "os" | |
| ) | |
| func init() { |
| # Plugin for the diamond to collect stats from Riak over HTTP. | |
| # | |
| # Copyright (c) 2013, Metricfire Ltd (Hosted Graphite) | |
| # All rights reserved. | |
| # | |
| # Redistribution and use in source and binary forms, with or without | |
| # modification, are permitted provided that the following conditions are met: | |
| # * Redistributions of source code must retain the above copyright | |
| # notice, this list of conditions and the following disclaimer. | |
| # * Redistributions in binary form must reproduce the above copyright |
| #!/bin/sh | |
| # check for where the latest version of IDEA is installed | |
| IDEA=`ls -1d /Applications/IntelliJ\ * | tail -n1` | |
| wd=`pwd` | |
| # were we given a directory? | |
| if [ -d "$1" ]; then | |
| # echo "checking for things in the working dir given" | |
| wd=`ls -1d "$1" | head -n1` |
| #!/bin/bash | |
| # This script keeps watch on the current project and compiles it continuously as you change files. | |
| # If there are multiple projects with the same final directory name (e.g., /proj/rad and /lib/monster/rad), | |
| # this will kill any other similarly-named running projects' binaries, potentially leading to havoc. | |
| # To run, install fswatch, drop this file into your project directory, make it executable, and run: | |
| # /usr/local/bin/fswatch ./ ./continuous-compile.sh | |
| echo "Re-compiling" |
| #!/bin/bash | |
| # * * * * * root /path/to/riak_graphite_stats.sh | |
| set -e | |
| SOURCE=$(hostname) | |
| GRAPHITE_PORT=2003 | |
| GRAPHITE_SERVER="server" | |
| PREFIX="riak_stats" | |
| STATUS=$(/usr/sbin/riak-admin status) |