Skip to content

Instantly share code, notes, and snippets.

@interface UIImage (fixOrientation)
- (UIImage *)fixOrientation;
@end
cdd () {
repo_folder="/Work/Development"
test=`find $repo_folder/* -maxdepth 0 -type d | grep -i "$1" -m 1`
if [ ! $1 ] || [ ! $test ]; then
cd $repo_folder
else
cd $test
fi
}
#! /bin/sh
lsof -n -i4TCP:$1 | grep LISTEN
pid=`lsof -n -i4TCP:$1 | grep LISTEN | awk '{print $2}'`
if [ $pid ]
then
kill -9 $pid
echo "[`date "+%Y-%m-%d %H:%M:%S"`] Process kill successfull!"
else
echo "[`date "+%Y-%m-%d %H:%M:%S"`] No process exists on port $1."
/**
* $Revision: 4005 $
* $Date: 2006-06-16 08:58:27 -0700 (Fri, 16 Jun 2006) $
*
* Copyright (C) 2005-2008 Jive Software. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
find / -name "svndata" //查找svndata的文件
-(void)testGroupAndSemaphore{
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
dispatch_group_t group = dispatch_group_create();
dispatch_semaphore_t sem1 = dispatch_semaphore_create(0);
dispatch_semaphore_t sem2 = dispatch_semaphore_create(0);
dispatch_semaphore_t sem3 = dispatch_semaphore_create(0);
dispatch_group_async(group, queue, ^{
[self methodWithABlock:^{
@coolgo
coolgo / p4merge
Created October 16, 2015 05:39 — forked from henrik242/p4merge
Helper script for p4merge and Git on MacOSX
#!/bin/bash
for arg; do [[ $arg = /* ]] || arg=$PWD/$arg; absargs+=("$arg"); done;
/Applications/p4merge.app/Contents/Resources/launchp4merge "${absargs[@]}"