Skip to content

Instantly share code, notes, and snippets.

View jchudzynski's full-sized avatar

Janusz Chudzynski jchudzynski

View GitHub Profile
@jchudzynski
jchudzynski / Deck.h
Created January 13, 2014 22:25
Deck.h created to show how to parse XML documents.
#import <Foundation/Foundation.h>
@interface Deck : NSObject
@property(nonatomic, strong) NSMutableArray * questions;
@property(nonatomic, strong) NSString * name;
@end
@jchudzynski
jchudzynski / Deck.m
Created January 13, 2014 22:27
Deck.m used to show how to parse XML documents.
#import "Deck.h"
@implementation Deck
-(instancetype)init{
if(self= [super init]){
_questions = [NSMutableArray new];
}
return self;
}
@jchudzynski
jchudzynski / tableViewExample.m
Created February 4, 2014 19:50
UITableViewDataSource
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyReuseIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier];
}
// format the cell
return cell;
}
@jchudzynski
jchudzynski / tableviewformat.m
Created February 4, 2014 20:44
Formatting table view's cell
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *MyIdentifier = @"MyReuseIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier];
}
// format the cell
cell.textLabel.text =@"";
cell.imageView.image =[UIImage imageNamed:@"icon"];
@jchudzynski
jchudzynski / TableViewExample.m
Created February 4, 2014 21:06
Example of complete View Contr
// AlbumListData.m
// Created by Janusz Chudzynski on 3/25/13
#import "AlbumListData.h"
#import "Album.h"
@interface AlbumListData()<UITableViewDelegate, UITableViewDataSource>
@property (nonatomic,weak) UITableView * tableView;
@property (nonatomic,strong) NSArray * objects;
package com.itenwired.itenconference.model;
import android.util.Log;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
/**
* Created by blcooley on 9/10/13.
@jchudzynski
jchudzynski / Monkey
Created April 3, 2014 20:01
Stress Testing application using monkey tool
jmc72$ ./adb shell monkey -p com.example.testingandroid -v 500
:Monkey: seed=1397651478340 count=500
:AllowPackage: com.example.testingandroid
:IncludeCategory: android.intent.category.LAUNCHER
:IncludeCategory: android.intent.category.MONKEY
// Event percentages:
// 0: 15.0%
// 1: 10.0%
// 2: 2.0%
// 3: 15.0%
@jchudzynski
jchudzynski / TwitterDateFormatter
Created April 14, 2015 16:25
Parses twitter date and outputs a string in new format
// Playground - noun: a place where people can play
import UIKit
func parseTwitterDate(twitterDate:String, outputDateFormat:String)->String?{
let formatter = NSDateFormatter()
formatter.dateFormat = "EEE MMM dd HH:mm:ss Z yyyy"
@jchudzynski
jchudzynski / RemoveNTh.swift
Created April 30, 2015 21:22
LeetCode Remove nth element from the end from linked list in Swift.
class ListNode{
var val:Int?
var next:ListNode?
init(){}
init(x:Int){
self.val = x
}
}
@jchudzynski
jchudzynski / students.csv
Last active October 29, 2015 15:28
Bulk Import of Students
Daniel Ley db@students.edu
Kyl Cunn kb@students.edu
Debah Gler dl@students.edu