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
bower_components/ | |
node_modules/ | |
tmp/ | |
.AppleDouble | |
.LSOverride | |
.DS_Store | |
.DS_Store? | |
._* | |
.Spotlight-V100 | |
.Trashes |
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
# Recursively find all files in the current directory and change to access of 644 | |
find ./ -type f -exec chmod 644 {} \; | |
# Recursively find all directories in the current directory and change to access of 755 | |
find ./ -type d -exec chmod 755 {} \; |
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
server { | |
listen 80; | |
server_name images.example.com; | |
access_log /var/sites/images.example.com/logs/access.log; | |
error_log /var/sites/images.example.com/logs/error.log; | |
root /var/sites/images.example.com/htdocs; | |
location / { | |
index index.php index.html index.htm; | |
} | |
location = /favicon.ico { |
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
# Author Jonathon Hibbard | |
##################### Godaddy Apache .htaccess for example.com ##################### | |
Options +FollowSymlinks | |
RewriteEngine On | |
RewriteBase / | |
##################### Try and prevent looping madness ##################### | |
RewriteCond %{ENV:REDIRECT_STATUS} 200 | |
RewriteRule .* - [L] |
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
find /sources/github -type d -maxdepth 1 -exec cp -i /documents/LICENSE {} \; |
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
- (CGImageRef)createMaskFromAlphaChannel:(UIImage *)image | |
{ | |
size_t width = image.size.width; | |
size_t height = image.size.height; | |
NSMutableData *data = [NSMutableData dataWithLength:width*height]; | |
CGContextRef context = CGBitmapContextCreate( | |
[data mutableBytes], width, height, 8, width, NULL, kCGImageAlphaOnly); |
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
@interface NSObject (MHOverride) | |
/* | |
* Dynamically overrides the specified method on this particular instance. | |
* | |
* The block's parameters and return type must match those of the method you | |
* are overriding. However, the first parameter is always "id _self", which | |
* points to the object itself. | |
* |
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
// | |
// ARSearchBar.h | |
// Artsy Folio | |
// | |
// Created by orta therox on 18/04/2012. | |
// Released under The MIT License | |
// http://www.opensource.org/licenses/mit-license.php | |
// | |
// Copyright (c) 2012 http://art.sy. All rights reserved. | |
// |
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
-(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { | |
NSString *textValue = textField.text; | |
if(textValue.length > 0 && string.length > 0) { | |
NSRange dotRange = [textValue rangeOfString:@"."]; | |
BOOL isDot = [string isEqualToString:@"."]; | |
if(isDot) { | |
return (dotRange.length == 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
@interface someController : UIViewController | |
@property (nonatomic, weak) UITextField *someTextField; | |
-(void)dismissKeyboard; | |
@end |
NewerOlder