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
// FROM: http://svn.cocoasourcecode.com/SkinnableApp/AppController.m | |
// | |
// AppController.m | |
// SkinnableApp | |
// | |
// Created by Matt Gemmell on 24/02/2008. | |
// Copyright 2008 Magic Aubergine. All rights reserved. | |
// | |
#import "AppController.h" |
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
# Image well | |
def addImage(sender) | |
return unless recipe = recipeArrayController.selectedObjects.lastObject | |
p recipe # => #<NSManagedObject_Recipe_:0x800525ee0> | |
openPanel = NSOpenPanel.openPanel | |
openPanel.canChooseDirectories = false | |
openPanel.canCreateDirectories = false | |
openPanel.allowsMultipleSelection = false |
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
# Image well | |
def addImage(sender) | |
return unless recipe = recipeArrayController.selectedObjects.lastObject | |
p recipe # => #<NSManagedObject_Recipe_:0x800525ee0> | |
openPanel = NSOpenPanel.openPanel | |
openPanel.canChooseDirectories = false | |
openPanel.canCreateDirectories = false | |
openPanel.allowsMultipleSelection = false |
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
# Returns the persistent store coordinator for the application. This | |
# implementation will create and return a coordinator, having added the | |
# store for the application to it. (The folder for the store is created, | |
# if necessary.) | |
def persistentStoreCoordinator | |
if @persistentStoreCoordinator | |
return @persistentStoreCoordinator | |
end | |
error = Pointer.new_with_type('@') |
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
# http://henrik.nyh.se/2008/12/git-dirty-prompt | |
# http://www.simplisticcomplexity.com/2008/03/13/show-your-git-branch-name-in-your-prompt/ | |
# username@Machine ~/dev/dir[master]$ # clean working directory | |
# username@Machine ~/dev/dir[master*]$ # dirty working directory | |
function parse_git_deleted { | |
[[ $(git status 2> /dev/null | grep deleted:) != "" ]] && echo "-" | |
} | |
function parse_git_added { | |
[[ $(git status 2> /dev/null | grep "Untracked files:") != "" ]] && echo '+' |
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
module ChocTop::Appcast | |
def make_build | |
sh "xcodebuild -configuration Release" | |
end | |
def make_dmg | |
FileUtils.rm_rf pkg | |
sh "hdiutil create -volname '#{name}' -srcfolder 'build/Release/#{target}' '#{pkg}'" | |
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
/* | |
Copyright (C) 2007 Stig Brautaset. All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
Redistributions of source code must retain the above copyright notice, this | |
list of conditions and the following disclaimer. | |
Redistributions in binary form must reproduce the above copyright notice, |
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
var list = $$('ul.entry-list li'); | |
for (var i = 0; i < list.length; i++) { | |
var li = list[i]; | |
if (!(li.innerHTML.match(/Available for hire/))) { | |
li.parentNode.removeChild(li); | |
} | |
} |
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
# For mocha integration, add this file into features/support folder | |
require "mocha" | |
World(Mocha::Standalone) | |
Before do | |
mocha_setup | |
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
def advertise! | |
puts "* Advertising on bonjour" | |
tr = DNSSD::TextRecord.new | |
tr["uri"] = web_uri | |
tr["name"] = Bananajour.config.name | |
DNSSD.register("#{config.name}'s bananajour", "_bananajour._tcp", nil, web_port, tr) {} | |
end |