Skip to content

Instantly share code, notes, and snippets.

View iggym's full-sized avatar
🎯
😄

Iggy iggym

🎯
😄
View GitHub Profile
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.clayallsopp.isawesome"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".OfflineListActivity"
android:label="@string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
// To create a coupon or storecard feature in your app
// you can do the following
@interface Card : NSObject <KCSPersistable>
@property (nonatomic, retain) NSString *cardId;
@property (nonatomic, retain) NSString *code;
@property (nonatomic, retain) NSString *cardName;
@property (nonatomic, retain) NSString *firstName;
@property (nonatomic, retain) NSString *lastName;
// In your view controller
// Make sure you have a class that stores image metadata
// For example, you could have your MyMetadata class with
// the following iVars:
// name -- The name of the image
// size -- The expected size of the image
// date -- The time the picture was taken
// location -- The place the image was taken
// peopleInPhoto -- An array of the 'id' attribute from KCSUsers
// in the picture
@iggym
iggym / onpubcom_array_date_sort.js
Created November 8, 2012 22:32 — forked from onpubcom/onpubcom_array_date_sort.js
How to Sort an Array of Dates with JavaScript
<script type="text/javascript">
// First let's create an array of JavaScript Date
// objects.
// More info about the Date class:
// http://w3schools.com/js/js_obj_date.asp
var dates = [
new Date(2010, 4, 10, 10, 07, 16),
new Date(2010, 4, 8, 9, 16, 09),
new Date(2010, 3, 30, 0, 15, 49),
@iggym
iggym / all types implementing an interface
Created December 18, 2012 20:41
all types implementing an interface
//Loop assemblies ,loop types, check if implemented
var type = typeof(IMyInteraface);
var types = AppDomain.CurrentDomain.GetAssemblies().ToList()
.SelectMany(s => s.GetTypes())
.Where(p => type.IsAssignableFrom(p));
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds))];
scrollView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
scrollView.pagingEnabled = YES;
[self.view addSubview:scrollView];
NSArray *images = @[@"image1", @"image2", @"image3"];
[images enumerateObjectsUsingBlock:^(NSString *imageName, NSUInteger idx, BOOL *stop) {
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:imageName]];
imageView.frame = CGRectMake(idx * CGRectGetWidth(self.view.bounds), 0, CGRectGetWidth(self.view.bounds), CGRectGetHeight(self.view.bounds));
[self.scrollView addSubview:imageView];
//
// CCamera.h
// CCamera
//
// Created by Jonathan Wight on 7/12/12.
// Copyright (c) 2012 Jonathan Wight. All rights reserved.
//
#import <Foundation/Foundation.h>
- (void)setupCaptureSession
{
NSError *error = nil;
AVCaptureSession *session = [[AVCaptureSession alloc] init];
session.sessionPreset = AVCaptureSessionPresetMedium;
AVCaptureDevice *device = [AVCaptureDevice
defaultDeviceWithMediaType:AVMediaTypeVideo];
@iggym
iggym / gist:5551104
Created May 9, 2013 22:30
UIAlertView basics
//basic alert view , remember <UIAlertViewDelegate>
- (IBAction)showMessage:(id)sender {
UIAlertView *message = [[UIAlertView alloc] initWithTitle:@"Hello World!"
message:@"This is your UIAlertview message."
delegate:nil
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[message show];
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
#import <UIKit/UIKit.h>
@interface MySegueWithCustomAnimation : UIStoryboardSegue
@end