Skip to content

Instantly share code, notes, and snippets.

View vkostechko's full-sized avatar

Viacheslav vkostechko

  • Warsaw, Poland
View GitHub Profile
@0xced
0xced / Emoji.json
Last active November 22, 2023 15:53
Extract emoji by category using the EmojiFoundation framework
{
"People" : [
"😀",
"😃",
"😄",
"😁",
"😆",
"😅",
"😂",
"🤣",
@sbishopwta
sbishopwta / gist:82b1726bc50992583dde04693de0515e
Created September 9, 2016 16:00
Swift 3 - Load JSON file
let filePath = Bundle.main.pathForResource("YOUR_FILE_NAME", ofType: "json", inDirectory: nil)
if let filePath = filePath {
do {
let fileUrl = URL(fileURLWithPath: filePath)
let jsonData = try Data(contentsOf: fileUrl, options: .mappedIfSafe)
let json = try? JSONSerialization.jsonObject(with: jsonData)
} catch {
print(error)
fatalError("Unable to read contents of the file url")
@willthink
willthink / contact.m
Last active March 6, 2023 20:05
Using CNContactStore in Objective C to query contacts info
#import <Contacts/Contacts.h>
@implementation ContactsScan
- (void) contactScan
{
if ([CNContactStore class]) {
//ios9 or later
CNEntityType entityType = CNEntityTypeContacts;
if( [CNContactStore authorizationStatusForEntityType:entityType] == CNAuthorizationStatusNotDetermined)