-
Install nightly build of cargo. (rustfmt requires cargo 0.6.0 or newer)
$ curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly
-
Then install rustfmt,
$ cargo install --git https://github.com/rust-lang-nursery/rustfmt
-
Install emacs-rustfmt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* XPM */ | |
static char * nyan_xpm[] = { | |
"25 15 149 2", | |
" c None", | |
". c #522244", | |
"+ c #3F1E31", | |
"@ c #403326", | |
"# c #2C2F32", | |
"$ c #002D5B", | |
"% c #333333", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* XPM */ | |
static char * outerspace_xpm[] = { | |
"8 15 2 1", | |
" c None", | |
". c #333333", | |
"........", | |
"........", | |
"........", | |
"........", | |
"........", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: postgresql | |
product_version: 0.0.0.1 | |
metadata_version: '1.3' | |
target_installer_version: 1.0 | |
stemcell: | |
name: bosh-vsphere-esxi-ubuntu-trusty-go_agent | |
version: '2824' | |
file: bosh-stemcell-2824-vsphere-esxi-ubuntu-trusty-go_agent.tgz | |
md5: e42cf8db9f1a471ed062ff2c6723427a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'yaml' | |
require 'diplomat' | |
RAILS_ENV = ARGV[0] | |
x = YAML.load_file ARGV[1] | |
y = x.reduce({}) do |acc, (k, v)| | |
o = "#{RAILS_ENV}/#{k.downcase}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'tempfile' | |
require 'fileutils' | |
ARGV.each do |name| | |
temp_file = Tempfile.new('foo') | |
begin | |
File.open(name, 'r') do |file| | |
file.each_line do |l| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /tmp | |
wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm | |
rpm -ihv rpmforge-release*.rf.i686.rpm | |
yum -y install htop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Save and restore the state of tmux sessions and windows. | |
# TODO: persist and restore the state & position of panes. | |
set -e | |
dump() { | |
local d=$'\t' | |
tmux list-windows -a -F "#S${d}#W${d}#{pane_current_path}" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"bootstrap": true, | |
"server": true, | |
"datacenter": "con", | |
"data_dir": "/tmp/consul", | |
"encrypt": "yJqVBxe12ZfE3z+4QSk8qA==", | |
"log_level": "INFO", | |
"enable_syslog": true, | |
"ui_dir": "~/consul_config/dist", | |
"acl_datacenter": "con", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{----------------------------------------------------------------- | |
A "Tree" represents a binary tree. A "Node" in a binary tree | |
always has two children. A tree can also be "Empty". Below I have | |
defined "Tree" and a number of useful functions. | |
This example also includes some challenge problems :) | |
-----------------------------------------------------------------} |
OlderNewer