duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
| - (void) deleteAllContacts { | |
| CNContactStore *contactStore = [[CNContactStore alloc] init]; | |
| [contactStore requestAccessForEntityType:CNEntityTypeContacts completionHandler:^(BOOL granted, NSError * _Nullable error) { | |
| if (granted == YES) { | |
| NSArray *keys = @[CNContactPhoneNumbersKey]; | |
| NSString *containerId = contactStore.defaultContainerIdentifier; | |
| NSPredicate *predicate = [CNContact predicateForContactsInContainerWithIdentifier:containerId]; | |
| NSError *error; | |
| NSArray *cnContacts = [contactStore unifiedContactsMatchingPredicate:predicate keysToFetch:keys error:&error]; |
| git ls-files -m | xargs -I {} git update-index --assume-unchanged {} |
| #import <Contacts/Contacts.h> | |
| @implementation ContactsScan | |
| - (void) contactScan | |
| { | |
| if ([CNContactStore class]) { | |
| //ios9 or later | |
| CNEntityType entityType = CNEntityTypeContacts; | |
| if( [CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusNotDetermined) |
| #!/usr/bin/env ruby | |
| # What is this for? | |
| # This script fixes an issue appeared for some Xcode users where it would show long identifiers | |
| # in the list of simulators instead of usual short names. This is caused by duplicate simulators | |
| # being sometimes created after switching between Xcode versions, with the same | |
| # device type + runtime pair occurring more than once in your list of available simulators. | |
| # Instead of showing the same simulator name twice, Xcode defaults to simulator identifiers. | |
| # | |
| # What it does? |
| #import <Foundation/Foundation.h> | |
| // VARIABLE must be a variable declaration (NSString *foo) | |
| // VALUE is what you are checking is not nil | |
| // WHERE is an additional BOOL condition | |
| #define iflet(VARIABLE, VALUE) \ | |
| ifletwhere(VARIABLE, VALUE, YES) | |
| #define ifletwhere(VARIABLE, VALUE, WHERE) \ |
| package main | |
| import ( | |
| "bufio" | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" | |
| "strconv" | |
| "strings" |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| int addi(int a, int b) { | |
| return a + b; | |
| } | |
| char *adds(char *a, char *b) { | |
| char *res = malloc(strlen(a) + strlen(b) + 1); |
| #!/bin/bash | |
| # Link: <https://gist.github.com/jellybeansoup/db7b24fb4c7ed44030f4> | |
| # | |
| # A command-line script for incrementing build numbers for all known targets in an Xcode project. | |
| # | |
| # This script has two main goals: firstly, to ensure that all the targets in a project have the | |
| # same CFBundleVersion and CFBundleShortVersionString values. This is because mismatched values | |
| # can cause a warning when submitting to the App Store. Secondly, to ensure that the build number | |
| # is incremented appropriately when git has changes. | |
| # |
| - (void)animateTransition:(id <UIViewControllerContextTransitioning>)transitionContext | |
| { | |
| UIViewController* toController = [transitionContext viewControllerForKey:UITransitionContextToViewControllerKey]; | |
| UIViewController* fromController = [transitionContext viewControllerForKey:UITransitionContextFromViewControllerKey]; | |
| UIView* container = [transitionContext containerView]; | |
| //get rects that represent the top and bottom halves of the screen | |
| CGSize viewSize = fromController.view.bounds.size; | |
| CGRect topFrame = CGRectMake(0, 0, viewSize.width, viewSize.height/2); | |
| CGRect bottomFrame = CGRectMake(0, viewSize.height/2, viewSize.width, viewSize.height/2); |