Newsflash: Moved to https://github.com/jasonm23/Phoenix-config/
This is a nice, fairly comprehensive, relatively self-documenting, configuration for Phoenix.app, a lightweight scriptable OS X window manager.
| (defun operate-on-point-or-region (fn) | |
| "Get the current unspaced string at point, or the current region, if selected, and replace it with the return value of fn - an ordinary defun." | |
| (let (pos1 pos2 meat) | |
| (if (and transient-mark-mode mark-active) | |
| (setq pos1 (region-beginning) | |
| pos2 (region-end)) | |
| (setq pos1 (car (bounds-of-thing-at-point 'symbol)) | |
| pos2 (cdr (bounds-of-thing-at-point 'symbol)))) | |
| (setq meat (funcall fn (buffer-substring-no-properties pos1 pos2))) | |
| (delete-region pos1 pos2) |
| # Recursive hash compact | |
| def compact hash | |
| p = ->(k,v){ (v.kind_of?(Hash) and v.keys.length > 0) ? (v.delete_if(&p);false) : (v.nil? or (v.kind_of?(Hash) and v.keys.length == 0)) } | |
| hash.delete_if(&p) | |
| end | |
| class NestedAttributesForStrategy | |
| def association(runner) | |
| runner.run | |
| end | |
| def result(evaluation) | |
| evaluation.object.tap do |instance| | |
| evaluation.notify(:after_build, instance) | |
| return attributes(instance) | |
| end |
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'digitalocean' | |
| require 'yaml' | |
| if ARGV.length < 2 | |
| puts "Usage:\n" | |
| puts " do-dns-update domain subdomain\n\n" | |
| exit | |
| end |
| #!/bin/sh | |
| # Install: | |
| # | |
| # copy to /usr/local/bin | |
| # | |
| # Usage: | |
| # | |
| # git ignore [[pattern] [pattern] [...]] | |
| # |
This is a nice, fairly comprehensive, relatively self-documenting, configuration for Phoenix.app, a lightweight scriptable OS X window manager.
| function killjobs(){ | |
| for pid in $(jobs -p | cut -c8-13) | |
| do | |
| kill $pid | |
| done | |
| } |