Skip to content

Instantly share code, notes, and snippets.

View romanr's full-sized avatar
😶

Roman Roan romanr

😶
View GitHub Profile
#!/bin/sh
#
# An example hook script that is called after a successful
# commit is made.
#
# To enable this hook, rename this file to "post-commit".
path="path to application"
User="userforssh"
server="servername"
dist="/Users/justin/Apps/Play20/play dist"
#!/bin/bash
unzip -o filename-1.0
chmod a+x filename-1.0/start
gline=$(ps -ewwo pid,args | grep "play.core.server.NettyServer")
echo $gline
IN=$gline
set -- "$IN"
IFS=" "; declare -a Array=($*)
PlayProcess="$(ps -ewwo pid,args | grep "play.core.server.NettyServer")"
echo $PlayProcess
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
1033edge.com
11mail.com
123.com
123box.net
123india.com
123mail.cl
123qwe.co.uk
150ml.com
15meg4free.com
163.com
#define setFrameX(_a_, _x_) { CGRect tempframe = _a_.frame; tempframe.origin.x = _x_; _a_.frame = tempframe; }
#define setFrameY(_a_, _y_) { CGRect tempframe = _a_.frame; tempframe.origin.y = _y_; _a_.frame = tempframe; }
#define setFrameWidth(_a_, _w_) { CGRect tempframe = _a_.frame; tempframe.size.width = _w_; _a_.frame = tempframe; }
#define setFrameHeight(_a_, _h_) { CGRect tempframe = _a_.frame; tempframe.size.height = _h_; _a_.frame = tempframe; }
#define printDimensions(__X__) TVLog(@"%s : Origin:(%f, %f) Size:(%f, %f)", #__X__, __X__.frame.origin.x, __X__.frame.origin.y, __X__.frame.size.width, __X__.frame.size.height)
#define printSize(a) TVLog(@"%s : (%f, %f)", #a, a.width, a.height)
#define radiansForOrientation(_a_) (_a_ == UIInterfaceOrientationPortrait? 0 : _a_ == UIInterfaceOrientationLandscapeLeft? M_PI/2.f : _a_ == UIInterfaceOrientationLandscapeRight? -M_PI/2.f : _a_ == UIInterfaceOrientationPortraitUpsideDown? -M_PI : 0)
@romanr
romanr / gist:3899504
Created October 16, 2012 14:12
Setup RestKit Stack 0.20
//Create store and moc:
NSURL *baseURL = [NSURL URLWithString:myUrl];
RKObjectManager *objectManager = [RKObjectManager managerWithBaseURL:baseURL];
//not sure what this does but it's in example project
NSManagedObjectModel *managedObjectModel = [NSManagedObjectModel mergedModelFromBundles:nil];
RKManagedObjectStore *managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:managedObjectModel];
objectManager.managedObjectStore = managedObjectStore;
NSString *modelPath = nil;
@romanr
romanr / gist:3283389
Created August 7, 2012 08:45
Google analytics macros
// Google Analytics Macro
#define GA_INIT_TRACKER(ACCOUNT, PERIOD, DELEGATE) \
[[GANTracker sharedTracker] startTrackerWithAccountID:ACCOUNT \
dispatchPeriod:PERIOD \
delegate:DELEGATE];
#define GA_STOP_TRACKER \
[[GANTracker sharedTracker] stopTracker];
#define GA_TRACK_PAGE(PAGE) {\
@romanr
romanr / gist:3192047
Created July 28, 2012 06:11
Warning: Your developer_dir setting in macports.conf points to a non-existing directory. Since this is known to cause problems, please correct the setting or comment it and let macports auto-discover the correct path.
Warning: Your developer_dir setting in macports.conf points to a non-existing directory. Since this is known to cause problems, please correct the setting or comment it and let macports auto-discover the correct path.
xcode-select --print-path
sudo nano /opt/local/etc/macports/macports.conf
@romanr
romanr / mpnml
Created July 27, 2012 16:20 — forked from holms/mpnml
Mysql, Php-fpm, Nginx on OSX Mountain Lion
sudo port -v install mysql5-server
sudo -u _mysql mysql_install_db5
# if above command produce this error: ERROR: 1004 Can't create file '/var/tmp/#sqle967_1_0.frm' (errno: 9)
# do this:
# sudo chown -R mysql:mysql /opt/local/var/db/mysql5
# sudo chmod u+rwx,go= /opt/local/var/db/mysql5
# sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
@romanr
romanr / mpnml
Created July 27, 2012 16:20 — forked from holms/mpnml
Mysql, Php-fpm, Nginx on OSX Mountain Lion
sudo port -v install mysql5-server
sudo -u _mysql mysql_install_db5
# if above command produce this error: ERROR: 1004 Can't create file '/var/tmp/#sqle967_1_0.frm' (errno: 9)
# do this:
# sudo chown -R mysql:mysql /opt/local/var/db/mysql5
# sudo chmod u+rwx,go= /opt/local/var/db/mysql5
# sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql