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
javascript:(function()%7Bjavascript%3Awindow.location.href%3D'ShortTail%3A%2F%2F'%2Bwindow.location.href%7D)(); |
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
- (void) calculateDates { | |
NSDate *todayDate = [[NSDate alloc] init]; | |
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
NSDateComponents *tomorrowOffset = [[NSDateComponents alloc] init]; | |
[tomorrowOffset setDay:1]; | |
NSDateComponents *yesterdayOffset = [[NSDateComponents alloc] init]; | |
[yesterdayOffset setDay:-1]; | |
NSDate *tomorrowDate = [gregorian dateByAddingComponents:tomorrowOffset toDate:todayDate options:0]; | |
NSDate *yesterdayDate = [gregorian dateByAddingComponents:yesterdayOffset toDate:todayDate options:0]; |
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
#import "UIImage+ImageEffects.h" | |
// Blur view while sidebar is open | |
UIGraphicsBeginImageContext(self.tableView.contentSize); | |
CGContextRef c = UIGraphicsGetCurrentContext(); | |
CGContextTranslateCTM(c, 0, 0); | |
[self.view.layer renderInContext:c]; | |
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); | |
viewImage = [viewImage applyBlurWithRadius:3.5 tintColor:nil saturationDeltaFactor:1.4 maskImage:nil]; | |
UIGraphicsEndImageContext(); |
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
<?php | |
// Show relative time if more recent than 60 days for post or comment | |
function adamdehaven_human_time_diff( $type = 'post', $duration = 60 ) { | |
if($type == 'comment') { | |
$post_time = get_comment_time('U'); | |
} else { | |
$post_time = get_the_time('U'); | |
} | |
$human_time = ''; |
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
<?php | |
function getStatusCodeMessage($status) | |
{ | |
// these could be stored in a .ini file and loaded | |
// via parse_ini_file()... however, this will suffice | |
// for an example | |
$codes = Array( | |
100 => 'Continue', | |
101 => 'Switching Protocols', | |
200 => 'OK', |
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
/* ============================================================================= | |
CSS Declarations | |
========================================================================== */ | |
/* ==|== The Standard Way =================================================== */ | |
.foo::before { | |
/* ...css rules... */ | |
} |
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 | |
case "$(curl -s --max-time 2 -I $1 | sed 's/^[^ ]* *\([0-9]\).*/\1/; 1q')" in [23]) echo "HTTP connectivity is up";; 5) echo "The web proxy will not let us through";; *) echo "The network is down or very slow";; esac | |
### Run | |
# $ bash network-connectivity.sh http://google.com/ | |
### Result | |
# $ HTTP connectivity OK |
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 | |
status=$(curl $1 -s -L -I -o /dev/null -w '%{http_code}') | |
echo $status | |
### Run | |
# $ bash http-status.sh http://google.com/ |
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
# -*- Conf -*- | |
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
showbranch = auto | |
ui = true | |
# color.branch | |
# A boolean to enable/disable color in the output of git-branch(1). May be set to always, false (or |
OlderNewer