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
Show hidden characters
{ | |
"always_show_minimap_viewport": true, | |
"bold_folder_labels": true, | |
"color_scheme": "Packages/Material Theme/schemes/Material-Theme-Darker.tmTheme", | |
"font_face": "Roboto Mono", | |
"font_size": 13, | |
"highlight_line": true, | |
"highlight_modified_tabs": true, | |
"ignored_packages": | |
[ |
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)reposition { | |
// https://developer.apple.com/library/ios/#qa/qa2010/qa1688.html | |
// tl;dr Only the first subview in the window receives orientation changes. | |
// So we apply a transform manually to rotate the view, and change the origin of the frame so | |
// that it remains in a top-center position for the user. | |
UIInterfaceOrientation orientation = | |
[UIApplication sharedApplication].statusBarOrientation; | |
UIWindow *keyWindow = [[UIApplication sharedApplication] keyWindow]; | |
CGAffineTransform viewTransform = CGAffineTransformIdentity; |
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
// Solution from http://stackoverflow.com/questions/5036971/find-locale-currency-for-iphone-programmatically/5039433#5039433 | |
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init]; | |
[formatter setNumberStyle:NSNumberFormatterCurrencyStyle]; | |
[formatter setLocale:[NSLocale currentLocale]]; | |
NSString *localizedMoneyString = [formatter stringFromNumber:myCurrencyNSNumberObject]; |
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
// | |
// DZLogger.h | |
// DZLogger | |
// | |
// Created by Nikhil Nigade on 11/12/13. | |
// Copyright (c) 2013-2014 Nikhil Nigade. All rights reserved. | |
// | |
// Async | |
//#define LogDZ(fmt,...) {\ |
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
- (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath { | |
return @"More"; | |
} | |
- (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath { | |
NSLog(@"I wanted to be a pretty public API, but then time ran out and they forgot me..."); | |
// Hide the More/Delete menu. | |
[self setEditing:NO animated:YES]; | |
} |
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
// For details, see http://mindsea.com/2012/12/18/downscaling-huge-alassets-without-fear-of-sigkill | |
#import <AssetsLibrary/AssetsLibrary.h> | |
#import <ImageIO/ImageIO.h> | |
// Helper methods for thumbnailForAsset:maxPixelSize: | |
static size_t getAssetBytesCallback(void *info, void *buffer, off_t position, size_t count) { | |
ALAssetRepresentation *rep = (__bridge id)info; | |
NSError *error = nil; |
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
{ | |
"USD": { | |
"symbol": "$", | |
"name": "US Dollar", | |
"symbol_native": "$", | |
"decimal_digits": 2, | |
"rounding": 0, | |
"code": "USD", | |
"name_plural": "US dollars" | |
}, |
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
// | |
// NSDictionary+JSON.h | |
// DiamConnect | |
// | |
// Created by Nikhil Nigade on 8/13/14. | |
// Copyright (c) 2014 agilepc-107. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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 | |
# from here: http://www.codingsteps.com/install-redis-2-6-on-amazon-ec2-linux-ami-or-centos/ | |
# and here: https://raw.github.com/gist/257849/9f1e627e0b7dbe68882fa2b7bdb1b2b263522004/redis-server | |
############################################### | |
# To use: | |
# wget https://gist.githubusercontent.com/dezinezync/e77945ea65b10c2677d2/raw/1353f39cdf724972e5d8c14100c8d2428358c19d/install-redis.sh | |
# chmod 777 install-redis.sh | |
# ./install-redis.sh | |
############################################### | |
echo "*****************************************" |