Skip to content

Instantly share code, notes, and snippets.

@deivuh
deivuh / gist:01af021bfd3b32ac921a
Created July 24, 2014 06:04
Git ignore file changes
Ignore file changes
git update-index --assume-unchanged <file>
Undo
git update-index --no-assume-unchanged <file>
@deivuh
deivuh / customURL.m
Last active August 29, 2015 14:04 — forked from mralexgray/customURL.m
Here is what you need to do to register your app for a custom URL scheme (for the example we will use a "myapp" scheme).
1) In your Info.plist, add a new entry for CFBundleURLTypes:
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>MyApp's URL</string>
<key>CFBundleURLSchemes</key>
@deivuh
deivuh / PrepareForSegueiOS
Created July 10, 2014 02:51
Prepare for Segue iOS, to pass around objects between view controllers when using story board segues
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:@"<#SEGUE_NAME#>"])
{
TheViewController *vc = [segue destinationViewController];
[vc setObject:object];
}
@deivuh
deivuh / Objective C REST
Last active August 29, 2015 14:03
Objective C REST request, receive and parse json into dictionary
- (void) sendRequest {
receivedData = [[NSMutableData alloc] init];
NSLog(@"Initial data length: %d",[receivedData length]);
requestURL = [NSString stringWithFormat:@"<#URL HERE#>"];
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:requestURL]];
[request setHTTPMethod:@"GET"];
#!/bin/sh
#
# myservice This shell script takes care of starting and stopping
# the /home/webreports/report-listen
#
# Source function library
. /etc/rc.d/init.d/functions