Skip to content

Instantly share code, notes, and snippets.

View andrewsardone's full-sized avatar

Andrew Sardone andrewsardone

View GitHub Profile
(defun markdown-custom ()
"markdown-mode-hook"
(longlines-mode))
(add-hook 'markdown-mode-hook '(lambda() (markdown-custom)))
(provide 'defuns)
#import "AppController.h"
@implementation AppController
- (void)awakeFromNib {
NSMenu *menu = [self createMenu];
menuItem = [[[NSStatusBar systemStatusBar] statusItemWithLength:24] retain];
[menuItem setImage:[NSImage imageNamed:@"41-picture-frame"]];
[menuItem setTarget:self];
# Cookie cutter code from ActiveRecord::Callbacks
# Adds before_move and after_move callbacks for the awesome_nested_set
# plugin by Collective Idea
# http://github.com/collectiveidea/awesome_nested_set/tree/master
#
# RAILS_ROOT/vendor/plugins/awesome_nested_set_extensions/lib/callbacks.rb
module CollectiveIdea #:nodoc:
module Acts #:nodoc:
module NestedSet #:nodoc:
# text_children_of_element(REXML::XPath.first(node, query))
def text_children_of_element(e, s=[])
if e.has_elements?
s << ""
e.each_element { |el| text_value_of_element(el,s) }
elsif e.has_text?
s << e.text.chomp
end
s.join(" ")
$ git checkout -f 03712e55d876484c383c13422bd4f26f34c59a82
FATAL: Could not checkout 03712e55d876484c383c13422bd4f26f34c59a82
Command returned status code 1: error: git checkout-index: unable to create symlink product/mms/conf/mms.props.www.vm.nejm.org.xml (File name too long)
#!/usr/bin/env macruby
# example using Twitter API
framework 'Cocoa'
framework 'JSON'
url = NSURL.URLWithString "http://twitter.com/statuses/public_timeline.json"
request = NSURLRequest.requestWithURL(url)
response = NSURLConnection.sendSynchronousRequest(request, returningResponse:nil, error:nil)
json_string = NSString.alloc.initWithData(response, encoding:NSUTF8StringEncoding)
#!/usr/bin/env bash
[[ -n "$1" ]] || { echo "Usage: $0 project_name"; exit 0 ; }
mkdir -m 770 $1.git
cd $1.git
git --bare init --shared=group
#!/usr/bin/env bash
#
# makeGitRepo
[[ -n "$1" ]] || { echo "Usage: $0 project_name"; exit 0 ; }
mkdir -m 770 $1.git
cd $1.git
git --bare init --shared=group
pushd /Volumes/JungleDisk/Git
makeGitRepo project