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
extension UIImage { | |
/** | |
Create gradient image from beginColor on top and end color at bottom | |
- parameter beginColor: beginColor | |
- parameter endColor: endColor | |
- parameter frame: frame to be filled | |
- returns: filled image | |
*/ |
# Copyright 1999-2011 Gentoo Foundation | |
# Distributed under the terms of the GNU General Public License v2 | |
# | |
# /etc/screenrc | |
# | |
# This is the system wide screenrc. | |
# | |
# You can use this file to change the default behavior of screen system wide | |
# or copy it to ~/.screenrc and use it as a starting point for your own | |
# settings. |
find . -type f -name "*.swift" -not -path "./Pods/*" -exec sed -i '' -e '1,/^import/{/^\/\/.*/d;}' -e '/./,$!d' {} \; |
extension UIView { | |
func shake(duration: CFTimeInterval) { | |
let translation = CAKeyframeAnimation(keyPath: "transform.translation.x"); | |
translation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) | |
translation.values = [-5, 5, -5, 5, -3, 3, -2, 2, 0] | |
let rotation = CAKeyframeAnimation(keyPath: "transform.rotation.z") | |
rotation.values = [-5, 5, -5, 5, -3, 3, -2, 2, 0].map { | |
(let degrees: Double) -> Double in | |
let radians: Double = (M_PI * degrees) / 180.0 |
- (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) \ |