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 ruby | |
PASS_THROUGH = %w(PATH MANPATH EDITOR) | |
DIRECTORY = File.expand_path('~/.MacOSX') | |
FILENAME = File.join(DIRECTORY, 'environment.plist') | |
Dir.mkdir(DIRECTORY) unless File.exist?(DIRECTORY) | |
HEADER = <<EOT | |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> |
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
(defun pjones:org-goto (&optional alternative-interface) | |
"My version of `org-goto' that first widens the buffer (if | |
narrowed), jumps to the correct heading via `org-goto', then | |
narrows it again if necessary." | |
(interactive "P") | |
(let ((point-size (save-restriction (- (point-max) (point-min)))) | |
(buff-size (buffer-size))) | |
(widen) | |
(org-goto alternative-interface) | |
(if (/= buff-size point-size) (org-narrow-to-subtree)))) |
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
#!/bin/sh | |
whatisthere () { | |
for dir in `echo $PATH | sed 's/:/ /g'`; do | |
for file in $dir/*; do | |
base=`basename $file` | |
desc=`whatis $base 2>&1` | |
[ $? -eq 0 ] && echo $desc | |
done | |
done |
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
class Version | |
attr_reader(:major, :minor, :patch) | |
def initialize (version) | |
@major, @minor, @patch = | |
version.split('.').map(&:to_i) | |
end | |
def <=> (other) | |
return nil unless other.is_a?(Version) |
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 ruby | |
# Don't use this in production! | |
module ClassCounter | |
def self.extended (klass) | |
$stderr.puts("Injecting hacked `new' into `#{klass}'") | |
klass.instance_exec {@klass_count = 0} | |
end | |
def new (*) |
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
#!/bin/sh -e | |
################################################################################ | |
# This is a simple wrapper around cabal to build Haskell projects. | |
echo $NIX_GHC | |
################################################################################ | |
# Keep cabal from being affected by local configuration. | |
export HOME="$(mktemp -d)" |
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 ruby | |
################################################################################ | |
# Read a tab-separated file generated by PasswordSafe and use the | |
# pass(1) tool to record new passwords. | |
# | |
# To use this script: | |
# | |
# 1. Create and mount an encrypted disk image (cryptsetup). | |
# |
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 ruby | |
################################################################################ | |
# | |
# Watch out for the unusual argument evaluation rules with the new | |
# safe navigation operator in Ruby 2.3. | |
# | |
# It short circuits just like the logic operators. This is different | |
# than how the `try' method works in ActiveSupport. | |
# |
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
let | |
pkgs = import <nixpkgs> {}; | |
stdenv = pkgs.stdenv; | |
mysql = pkgs.mysql55; | |
in rec { | |
cltc-claims = stdenv.mkDerivation rec { | |
name = "cltc-claims"; | |
version = "0.0"; | |
src = ./.; |
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
services.compton = { | |
enable = true; | |
package = pkgs.compton-git; | |
fade = true; | |
fadeDelta = 5; | |
activeOpacity = "1.0"; | |
inactiveOpacity = "0.92"; | |
menuOpacity = "1.0"; | |
shadow = false; | |
extraOptions = '' |
OlderNewer