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 | |
| cd /Volumes/Cerberus; | |
| now = $(date +"%m_%d_%Y"); | |
| mkdir "Backup_$now"; | |
| cd "Backup_$now"; | |
| cp ~/ ./; |
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
| static void performOnUIThread(void (^Block)()) { | |
| dispatch_async(dispatch_get_main_queue(), Block); | |
| } |
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/bash | |
| apt-get update | |
| ( | |
| echo To: [email protected] | |
| echo From: reporting@`hostname` | |
| if [ "$( df -h | grep hda1 | cut -c40-42)" -ge "80" ]; then echo Subject: Production Server : Low Disk Space : Daily reporting for `date +%e\ %B\ %Y` | |
| else echo Subject: Production Server: Daily reporting for `date +%e\ %B\ %Y` | |
| fi | |
| echo Reporting of Production Server: `hostname` | |
| echo |
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
| html { | |
| -webkit-font-smoothing: antialiased; | |
| -moz-font-smoothing: antialiased; | |
| font-smoothing: antialiased; | |
| } |
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
| # Dovecot configuration file | |
| # If you're in a hurry, see http://wiki.dovecot.org/QuickConfiguration | |
| # "doveconf -n" command gives a clean output of the changed settings. Use it | |
| # instead of copy&pasting files when posting to the Dovecot mailing list. | |
| # '#' character and everything after it is treated as comments. Extra spaces | |
| # and tabs are ignored. If you want to use either of these explicitly, put the | |
| # value inside quotes, eg.: key = "# char and trailing whitespace " |
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 codeigniter() { | |
| git clone https://github.com/EllisLab/CodeIgniter.git "$@" ; | |
| } |
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
| NSArray *arrayCreate(id firstObject, ...) { | |
| NSMutableArray *objects = [NSMutableArray array]; | |
| [objects addObject:firstObject]; | |
| va_list args; | |
| va_start(args, firstObject); | |
| id arg; | |
| while ((arg = va_arg(args, id))) { | |
| if (arg == nil) | |
| break; | |
| [objects addObject:arg]; |
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
| - (UIImage *)normalizedImage { | |
| if (self.imageOrientation == UIImageOrientationUp) return self; | |
| UIGraphicsBeginImageContextWithOptions(self.size, NO, self.scale); | |
| [self drawInRect:(CGRect){0, 0, self.size}]; | |
| UIImage *normalizedImage = UIGraphicsGetImageFromCurrentImageContext(); | |
| UIGraphicsEndImageContext(); | |
| return normalizedImage; | |
| } |
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
| #pragma mark - Transparent Modal View | |
| -(void) presentTransparentModalViewController: (UIViewController *) aViewController | |
| animated: (BOOL) isAnimated | |
| withAlpha: (CGFloat) anAlpha{ | |
| self.transparentModalViewController = aViewController; | |
| UIView *view = aViewController.view; | |
| view.opaque = NO; | |
| view.alpha = anAlpha; |
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
| - (void) handlePan:(UIPanGestureRecognizer *) gesture { | |
| if ((gesture.state == UIGestureRecognizerStateChanged) || | |
| (gesture.state == UIGestureRecognizerStateEnded)) { | |
| CGPoint location = [gesture locationInView:[self.tableView superview]]; | |
| if (location.x <= (_tableView.frame.size.width / 2) + 40) { | |
| if (location.x < _tableView.frame.size.width / 2-70 && isFilterViewShowing) | |
| [self.tableView setFrame:CGRectMake(location.x, 0, _tableView.frame.size.width, _tableView.frame.size.height)]; | |
| else if (location.x < _tableView.frame.size.width / 2 + 40) |