This file contains hidden or 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
MyObject *obj = [[MyObject alloc] init]; | |
obj.property = @"OK"; | |
[obj doSomething]; | |
NSLog(@"%@", obj); |
This file contains hidden or 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
- (BOOL) textField: (UITextField *) textField shouldChangeCharactersInRange: (NSRange) range replacementString: (NSString *) string | |
{ | |
([(textField == self.serverField ? self.emailField : self.serverField).text length] > 0 && | |
[(textField == self.passwordField ? self.emailField : self.passwordField).text length] > 0 && | |
[[textField.text stringByReplacingCharactersInRange: range withString: string] length] > 0 | |
) ? (self.navigationItem.rightBarButtonItem.enabled = YES) : (self.navigationItem.rightBarButtonItem.enabled = NO) ; | |
return YES; | |
} |
This file contains hidden or 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(){if%20%28window.location.host%20%3D%3D%20%27twitter.com%27%29%7Ba%20%3D%20location.hash%3Bif%20%28a%20%3D%3D%20%27%27%29%7Ba%20%3D%20location.pathname%3B%7Da%20%3D%20a.split%28%27/%27%29%3Bb%20%3D%20a%5Ba.length%20-%201%5D%3Blocation.href%20%3D%20%27http%3A//favstar.fm/t/%27%20+%20b%3B%7D})(); |
This file contains hidden or 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/sh | |
while [ 1 ] | |
do | |
clear | |
echo "iPad 2 Wi-Fi White 16GB: " | |
# This magic courtesy of Garrett Murray: http://log.maniacalrage.net/post/4030658171/tip-how-to-get-an-ipad-2-at-target-today-i | |
# Thanks Garrett! I have barely an idea of how this works, but it is truly brilliant! :) | |
curl -s --data "_dyncharset=ISO-8859-1&asin=&dpci=057-10-1839&zipcode=YOUR_ZIP_CODE_GOES_HERE_BUB&city=&state=" http://sites.target.com/site/en/spot/mobile_fiats_results.jsp?_DARGS=/site/en/spot/mobile_fiats.jsp | grep -A 2 strong | sed -e 's/<p><strong>//' -e 's/<\/strong><br\/>//' -e 's/<br \/>//' -e 's/<\/p>//' -e 's/--//' -e 's/^[ \t]*//;s/[ \t]*$//' > ipad2-white.results |
This file contains hidden or 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 <UIKit/UIKit.h> | |
// Including the .h and .m file together for simplicity’s sake. | |
// yes, this is a horrific abuse of ObjC | |
@interface CSTextCell : UITableViewCell { | |
} | |
+ (id)generate:(UITableView *)tableView at:(NSIndexPath *)indexPath text:(NSString *)text; | |
+ (NSString *)cellID; |
This file contains hidden or 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
RewriteEngine on | |
# Force No-WWW | |
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] | |
RewriteRule ^(.*)$ http://%1/$1 [R=301,L] | |
# Force HTTPS | |
RewriteCond %{HTTPS} off | |
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
This file contains hidden or 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
# Check certificate expiration date | |
openssl x509 -in certificate.pem -noout -enddate | |
# Create new ECC key and CSR | |
openssl ecparam -out private.key -name prime256v1 -genkey | |
chmod 400 private.key | |
openssl req -new -key private.key -out csr.txt -subj '/CN=domain.tld' | |
# Create new RSA key and CSR | |
openssl req -out csr.txt -new -newkey rsa:4096 -sha256 -nodes -keyout private.key -subj '/CN=domain.tld' > /dev/null 2>&1 |
This file contains hidden or 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
<? | |
function normalize_header_name ($name) | |
{ | |
$name = substr($name, 5); | |
$name = str_replace('_', '-', $name); | |
$name = strtolower($name); | |
return $name; | |
} |
This file contains hidden or 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
<? | |
define('HESITANT', preg_match('/^hesitant/', $_SERVER['HTTP_HOST'])); | |
function hesitant ($m, $a = NULL) { return HESITANT ? $m : (is_null($a) ? '' : $a) ; } |