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
#pragma mark - Core Data stack | |
- (NSManagedObjectContext *)managedObjectContext | |
{ | |
if (_managedObjectContext != nil) { | |
return _managedObjectContext; | |
} | |
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; | |
if (coordinator != nil) { |
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
@implementation WSAppDelegate | |
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator; | |
@synthesize managedObjectModel = _managedObjectModel; | |
@synthesize managedObjectContext = _managedObjectContext; | |
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification | |
{ | |
NSManagedObjectContext *context = [self managedObjectContext]; | |
Names *name = [NSEntityDescription insertNewObjectForEntityForName:@"Names" inManagedObjectContext:context]; |
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
NSLog(@"%@", songTitle); | |
NSLog(@"%@", songDuration); | |
NSLog(@"%f", [songDuration floatValue]); | |
NSLog(@"%d", [songDuration integerValue]); |
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
# This file is sourced by /etc/init.d/sabnzbdplus | |
# | |
# When SABnzbd+ is started using the init script, the | |
# --daemon option is always used, and the program is | |
# started under the account of $USER, as set below. | |
# | |
# Each setting is marked either "required" or "optional"; | |
# leaving any required setting unconfigured will cause | |
# the service to not start. |
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
<?xml version='1.0' encoding='UTF-8'?> | |
<server xmlns="urn:jboss:domain:1.2"> | |
<extensions> | |
<extension module="org.jboss.as.clustering.infinispan"/> | |
<extension module="org.jboss.as.clustering.jgroups"/> | |
<extension module="org.jboss.as.cmp"/> | |
<extension module="org.jboss.as.configadmin"/> | |
<extension module="org.jboss.as.connector"/> |
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
# First add a rule for all local traffic to port 80 to go into pipe 1 | |
# 100 is the rule number which will be used for referencing the rule later | |
sudo ipfw add 100 pipe 1 ip from 127.0.0.1 to 127.0.0.1 dst-port http | |
# To display the rule use | |
# sudo ipfw show 100 | |
# configure the settings of the pipe as you please | |
# 50kbit/s bandwidth | |
sudo ipfw pipe 1 config bw 50Kbit | |
# 200ms lag |
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
Floor(N) -> ${N-(N%1)} | |
Ceiling(N) -> ${N+(1-(N%1))%1} | |
Round(N) -> ${N+((N%1>0.5)?(1-(N%1))%1:-(N%1))} |
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
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> | |
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> | |
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> | |
<%@ attribute name="pg" type="org.springframework.data.domain.Page" required="true" rtexprvalue="true" description="The current Page" %> | |
<c:set var="showPages" value="10" /> | |
<%-- No User Settings Below Here --%> |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
#!/bin/bash | |
WWW_PATH=/srv/www/public | |
DIST_DIR=./dist | |
RELEASE_DIR=$WWW_PATH/$JOB_NAME | |
RELEASE_NAME=$(echo $JOB_NAME | awk '{print tolower($0)}') | |
if [ ! -d "$RELEASE_DIR" ]; then | |
mkdir -p $RELEASE_DIR/testing |
OlderNewer