Skip to content

Instantly share code, notes, and snippets.

@YordiLorenzo
YordiLorenzo / psmodel.m
Last active August 29, 2015 14:23
Shows Guide Core Data snippet
- (BOOL) saveShow:(Show *)show {
if (! [self exists:show]) {
NSEntityDescription *entity = [NSEntityDescription entityForName:@"Show" inManagedObjectContext:self.managedObjectContext];
NSManagedObject *newShow = [[NSManagedObject alloc] initWithEntity:entity insertIntoManagedObjectContext:self.managedObjectContext];
NSError *error;
[newShow setValue:show.title forKey:@"title"];
[newShow setValue:[NSNumber numberWithLong:show.identifier] forKey:@"id"];
@YordiLorenzo
YordiLorenzo / 0_reuse_code.js
Created February 3, 2017 10:21
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@YordiLorenzo
YordiLorenzo / filters.swift
Created September 21, 2019 09:43
Eureka example
self.form +++ Section("Filters")
<<< SwitchRow("sort_by_distance_tag"){
$0.value = User.sharedInstance.filters?.sortByDistance ?? false
$0.title = "Sorteer op afstand"
}.onChange({ row in
UserManager()
.updateFilters(cities: nil, sort_by_distance: row.value, distance: nil, completion: nil)
})
<<< StepperRow() {
open class GetJobService<T: Mappable>: BaseService<T, ErrorMappable> {
open var hashId: String
public init (hashId: String) {
self.hashId = hashId
}
open override var endpoint: String {
return "api/v1/contractor/jobs/" + hashId + "?include=open_shifts.contractor_match.contractor,open_shifts.contractor_match.shift,open_shifts.contractor_match.contractor_has_worked_before,open_shifts.contractor_match.tariff_incl_costs,open_shifts.contractor_match.actions,open_shifts.contractor_match.contractor_status,open_shifts.contractor_match.substituted_by,open_shifts.contractor_match.substituting_for,open_shifts.contractor_match.can_claim_cancellation_fee,work_shifts.contractor_match.contractor,work_shifts.contractor_match.shift,work_shifts.contractor_match.contractor_has_worked_before,work_shifts.contractor_match.tariff_incl_costs,work_shifts.contractor_match.actions,work_shifts.contractor_match.contractor_status,work_shifts.contractor_match.substituted_by,work_shifts.contractor_match.su
@YordiLorenzo
YordiLorenzo / Job.swift
Created October 31, 2019 07:30
Job Entity mapping in iOS
//
// Job.swift
// Temper
//
// Created by Said Rehouni on 24/07/2017.
// Copyright © 2017 Temper B.V. All rights reserved.
//
import CoreLocation
import ObjectMapper