Skip to content

Instantly share code, notes, and snippets.

@rupey
rupey / FeedbackViewController.m
Last active January 7, 2016 02:14
Capturing customer feedback with a device log on iOS
#import <UIKit/UIKit.h>
#import <MessageUI/MessageUI.h>
#include <asl.h>
@interface FeedbackViewController : UIViewController <MFMailComposeViewControllerDelegate>
@property (nonatomic, strong) IBOutlet UITextView *textView;
@property (nonatomic, strong) NSString *feedbackType;
@end
@rupey
rupey / mandelbrot.sql
Last active December 7, 2020 05:38
Mandelbrot plot in postgres
WITH RECURSIVE
x(i) AS ( VALUES (0)
UNION ALL SELECT i + 1
FROM x
WHERE i < 101),
Z(Ix, Iy, Cx, Cy, X, Y, I) AS (
SELECT
Ix,
Iy,
X :: FLOAT,
@rupey
rupey / gist:f1429adab0877506c9fb
Created August 10, 2014 01:34
iTunes Store API rating count retriever snippet
#pragma mark - iTunes Store API
#define ITUNES_APP_ID @"870393074"
- (void)updateReviewCount
{
NSString *countryCode = [[[NSLocale currentLocale] objectForKey: NSLocaleCountryCode] lowercaseString];
NSString *url = [NSString stringWithFormat:@"https://itunes.apple.com/%@/lookup?id=%@", countryCode, ITUNES_APP_ID];
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];