- Open up Automator.app located in your Applications folder.
- Choose ”Service” in the dialog sheet when creating a new document.
- In the
Services receives selected:
menu at the top of the ”Canvas” on the right, change to ”Files & Folders”. - In the sidebar to the left, search for
Get Selected Finder Items
- Drag this Action to the ”canvas” on the right side.
- Again, go to the sidebar at the left and this time search for
Run Shell Script
- Drag the
Run Shell Script
action to the ”canvas” on the right side. - At the right in the
Run Shell Script
action, change thePass input
fromto stdin
toas arguments
- Copy paste this into the action text box, removing the
Cat
command in the text box:
Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.
In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.
Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j
@implementation UIImage (scale) | |
/** | |
* Scales an image to fit within a bounds with a size governed by | |
* the passed size. Also keeps the aspect ratio. | |
* | |
* Switch MIN to MAX for aspect fill instead of fit. | |
* | |
* @param newSize the size of the bounds the image must fit within. | |
* @return a new scaled image. |
package main | |
/* | |
URL: https://github.com/mccoyst/myip/blob/master/myip.go | |
URL: http://changsijay.com/2013/07/28/golang-get-ip-address/ | |
*/ | |
import ( | |
"net" | |
"os" |
#!/bin/bash | |
echo '#!/bin/bash' | |
echo '' | |
echo 'failed_items=""' | |
echo 'function install_package() {' | |
echo 'echo EXECUTING: brew install $1 $2' | |
echo 'brew install $1 $2' | |
echo '[ $? -ne 0 ] && $failed_items="$failed_items $1" # package failed to install.' | |
echo '}' |
def osascript(script) | |
system 'osascript', *script.split(/\n/).map { |line| ['-e', line] }.flatten | |
end | |
osascript <<-END | |
tell application "Finder" | |
display dialog "Hello" | |
end tell | |
END |
$this->set('documentData', array('xmlns:dc' => 'http://purl.org/dc/elements/1.1/', 'xmlns:atom' => 'http://www.w3.org/2005/Atom')); | |
$this->set('channelData', array( | |
'title' => __("Comercio Exterior", true), | |
'link' => 'http://www.aduanacol.com/news.rss', | |
'description' => __("Noticias más recientes de comercio exterior Colombiano.", true), | |
'language' => 'es-co', | |
'atom:link' => array( | |
'attrib' => array( | |
'href' => 'http://www.aduanacol.com/news.rss', |
NSTask* task = [[NSTask alloc] init]; | |
{ | |
[task setStandardOutput:[NSPipe pipe]]; | |
[task setStandardError:[NSPipe pipe]]; | |
[task setLaunchPath:...]; | |
[task setArguments:...]; | |
[task setTerminationHandler:^(NSTask* task) | |
{ | |
if ([task terminationStatus] == 0) | |
{ |
// clang -framework Cocoa app.m -o app | |
// ./app | |
#import <Cocoa/Cocoa.h> | |
int main() | |
{ | |
[NSAutoreleasePool new]; | |
id app = [NSApplication sharedApplication]; | |
[app setActivationPolicy:NSApplicationActivationPolicyRegular]; | |