Skip to content

Instantly share code, notes, and snippets.

View ayunav's full-sized avatar

Ayuna Vogel ayunav

View GitHub Profile
@ayunav
ayunav / Ayuna_Vogel_iOS_Developer_CV.md
Last active December 7, 2017 07:06
Ayuna_Vogel_iOS_Developer_CV.md

Ayuna_Vogel_iOS_Developer_CV

@ayunav
ayunav / StaticVarProperty.swift
Created February 19, 2017 03:54
Type property defined as a variable stored property
struct AudioChannel {
static var maxInputLevelForAllChannels = 0
}
@ayunav
ayunav / EnumTypeProperties.swift
Created February 19, 2017 03:20
Type properties on enums - Swift
import Foundation
enum MeetupAPI {
// MARK: - Properties
static let url = URL(string: "https://api.meetup.com/find/events?&sign=true&photo-host=public")
static let session: URLSession = {
let config = URLSessionConfiguration.default
@ayunav
ayunav / multipartFormData.swift
Created January 21, 2017 04:12
How to upload an image using multipartFormData method with Alamofire
// provide here the image that you want to upload, and
// a value between 0 and 1 where 1 is the highest quality
// https://developer.apple.com/reference/uikit/1624115-uiimagejpegrepresentation
let imageData = UIImageJPEGRepresentation(image, 0.8)
let url = yourUrl
Alamofire.upload(multipartFormData: { multipartFormData in
-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region {
NSArray <NLGoal*> *allGoals = [NLGoal goalsForCurrentUser];
UILocalNotification *localNotification = [[UILocalNotification alloc] init];
localNotification.alertTitle = @"Neverlate";
localNotification.timeZone = [NSTimeZone defaultTimeZone];
localNotification.fireDate = [NSDate date];
__weak typeof(self) weakSelf = self;
@ayunav
ayunav / anagram.swift
Created April 10, 2016 03:04
Determine if two strings are anagrams of each other
func stringIsAnagram(str1: String, str2 : String) -> Bool {
var dict1 = [Character: Int]()
var dict2 = [Character: Int]()
var count = 0
for char in str1.characters {
if (dict1[char] != nil) {
dict1[char] = count++
} else {
func profile(block:(()->())) {
let start = NSDate()
block()
let end = NSDate()
print(end.timeIntervalSinceDate(start))
}
//run your function/code inside the block below
profile({
@ayunav
ayunav / The Technical Interview Cheat Sheet.md
Created January 27, 2016 21:25 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@ayunav
ayunav / FSQSplitViewController.h
Created December 15, 2015 21:15 — forked from samgro/FSQSplitViewController.h
FSQSplitViewController
//
// FSQSplitViewController.h
//
// Copyright (c) 2015 Foursquare. All rights reserved.
//
#import "FSCoreViewController.h"
NS_ASSUME_NONNULL_BEGIN;
@ayunav
ayunav / PrettyRainbowUITableView.m
Last active August 29, 2015 14:27 — forked from theothertomelliott/PrettyRainbowUITableView.m
Pretty Rainbow UICollectionView
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
// Get your cell here
cell.backgroundColor = [UIColor colorWithHue:(float)indexPath.row/[collectionView numberOfItemsInSection:indexPath.section] saturation:0.8 brightness:1 alpha:1];
// Do more stuff here
}