Skip to content

Instantly share code, notes, and snippets.

View mrjeremyt's full-sized avatar

Jeremy Thompson mrjeremyt

View GitHub Profile
class SpockTheMagicDragon
{
protected static Password p;
public SpockTheMagicDragon(Password pwd) {
p = pwd;
}
protected static char[] charset = {33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,
57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,
- (void)viewDidLoad {
[super viewDidLoad];
[self registerKeyboardObservers];
[self initializeDaysOfWeek];
[self initializeSeasons];
[self initializeEpisodes];
[self initializeDelegates];
[self initializeDayTimePicker];
[self setupPickers];
[NSNumber numberWithInt:[[self.hours objectAtIndex:row] intValue]].integerValue;
@mrjeremyt
mrjeremyt / funTernary.m
Created August 18, 2015 20:40
Fun ternary I made
NSString *roomString = [self.infoDict objectForKey:csvString(CSVRoomNumber)];
roomString = ([NSNumber numberWithInt:[[self.infoDict objectForKey:csvString(CSVRooms)] intValue]].intValue > 1) ? [roomString substringWithRange:NSMakeRange(1, roomString.length-2)] : roomString;
<beans:bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close" >
<beans:property name="driverClass" value="org.postgresql.Driver" />
<beans:property name="jdbcUrl" value="jdbc:postgresql://postgresql2-214.c44wyjmff9e0.us-west-2.rds.amazonaws.com:5432/testsocial" />
<beans:property name= "user" value="rick" />
<beans:property name="password" value="batterystaple" />
</beans:bean>
import java.util.*;
/**
* Created by MrJeremyT on 6/30/15.
*/
// you can also use imports, for example:
// import java.util.*;
// you can use System.out.println for debugging purposes, e.g.
// System.out.println("this is a debug message");
@mrjeremyt
mrjeremyt / gist:1cc0e0b3b3d5da5bad32
Created June 30, 2015 21:55
BetterProgrammer certificate code
/**
* Created by MrJeremyT on 6/30/15.
*/
import java.util.ArrayList;
import java.util.List;
public class BetterProgrammerTask {
public static String getBinaryRepresentation(int n) {
/*
Please implement this method to
return a String with the binary representation of any number n, where n >= 0.
Example: "101" is a binary representation of 5
*/
}
[type completion:^(int){
thing;
}];
- (BOOL)splitViewController:(UISplitViewController *)splitViewController
collapseSecondaryViewController:(UIViewController *)secondaryViewController
ontoPrimaryViewController:(UIViewController *)primaryViewController {
if ([secondaryViewController isKindOfClass:[UINavigationController class]]
&& [[(UINavigationController *)secondaryViewController topViewController] isKindOfClass:[ViewController class]]
&& ([(ViewController *)[(UINavigationController *)secondaryViewController topViewController] pm] == nil)) {
// Return YES to indicate that we have handled the collapse by doing nothing; the secondary controller will be discarded.
return YES;