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
command_not_found_handle() { | |
# do not run when inside Midnight Commander or within a Pipe | |
if test -n "$MC_SID" -o ! -t 1 ; then | |
echo $"$1: command not found" | |
return 127 | |
fi | |
if test -x "/usr/local/git/libexec/git-core/git-$1"; then | |
echo "executing 'git $@'" | |
git "$@" |
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 Integer | |
def score | |
self * 20 | |
end | |
end | |
(4.score + 7).years.ago |
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
$j('#something').html('fetching'); | |
$j.ajax({ | |
url: '/path/to/epub.epub', | |
complete: function(response, status, request) { | |
var the_zip = new JSUnzip(response.responseText); | |
$j('#something').html('finished with ' + status); | |
console.log("is it zip?" + the_zip.isZipFile()); | |
var epub = new JSEpub(response.responseText); |
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 node | |
const exec = require('child_process').exec; | |
const spawn = require('child_process').spawn; | |
const R = require('ramda'); | |
const myInstance = 'your instance id'; | |
const myKey = 'absolute path to your private key'; | |
const myUser = 'username associated with the key pair'; | |
function isInstanceOff(instanceJson) { |
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
it "should show sorted stream if updated by author after reshare" do | |
# someone reshares | |
SocialPost.make :postable => @mac_pics, :user => @tim, :postable_type => "Story", :network_name => SocialUser::BLURB | |
# then the author updates, causing the original authored socialpost to update, pushing it to the "back" | |
@mac_pics.title = @mac_pics.title + "_" | |
@mac_pics.save! | |
debugger | |
@tony.story_stream.should == [@john_pics, @people_pics, @dog_pics, @mac_pics] | |
end |
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
WARN_ME="\n\ | |
!WARNING! \n\ | |
This change may contain a debugger line. Please make sure this is not the case before pushing. \n\ | |
!END WARNING! \n" | |
if git show | grep -q "debugger" | |
then | |
echo $WARN_ME | |
fi |
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
;; taken from http://snarfed.org/minimal_emacs_for_fast_startup | |
; cutoff for word wrap | |
(setq-default fill-column 79) | |
; F12 toggles auto-fill mode | |
(global-set-key [f12] 'auto-fill-mode) | |
; C-- keybinding for undo (removes the shift) | |
(global-set-key [(control -)] 'undo) |
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
[core] | |
editor = emacs -nw --no-init-file --no-site-file --load ~/.emacs.minimal |
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
it("adds zero-width breaking spaces betwee<wbr>n special characters in the 'content'", function() { | |
expect(EM.Text.fromBBF({content:"<span class=\"some-class\" style=\"font-size:10\" special chars %^&*"}).get('content')) | |
.toBe("something containing special chars %<wbr>^<wbr>&<wbr>amp;<wbr>*"); | |
}); | |
it("preserves the original content in 'raw_content'", function() { | |
expect(EM.Text.fromBBF({content:"something containing special chars %^&*"}).get('raw_content')) | |
.toBe("something containing special chars %^&*"); | |
}); |
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 'textmate) | |
(textmate-mode) | |
(global-set-key (kbd "M-t") 'textmate-goto-file) ;; for Aquamacs... |