{"id":18271698,"url":"https://github.com/gabriel/GHKit","last_synced_at":"2025-04-05T02:30:39.094Z","repository":{"id":420928,"uuid":"40780","full_name":"gabriel/GHKit","owner":"gabriel","description":"Utilities and categories for Objective-C","archived":false,"fork":false,"pushed_at":"2016-03-22T20:24:30.000Z","size":12792,"stargazers_count":260,"open_issues_count":5,"forks_count":40,"subscribers_count":21,"default_branch":"master","last_synced_at":"2025-03-03T20:02:12.844Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Objective-C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gabriel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-08-07T17:04:25.000Z","updated_at":"2023-12-25T22:38:50.000Z","dependencies_parsed_at":"2022-08-16T10:25:11.336Z","dependency_job_id":null,"html_url":"https://github.com/gabriel/GHKit","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel%2FGHKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel%2FGHKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel%2FGHKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gabriel%2FGHKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gabriel","download_url":"https://codeload.github.com/gabriel/GHKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247279241,"owners_count":20912850,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-05T11:39:27.680Z","updated_at":"2025-04-05T02:30:38.444Z","avatar_url":"https://github.com/gabriel.png","language":"Objective-C","readme":"# GHKit\n\nThe GHKit framework is a set of extensions and utilities for Mac OS X and iOS.\n\n## Podfile\n\n    pod \"GHKit\"\n\n## Usage\n\nGHKit defines various categories and general purpose utilities.\n\nFor example, parsing date strings, date math, string manipulations, URL dictionary formatting, etc. Some examples are below.\n\nAll categories are namespaced with gh_ to avoid conflicts.\n\n***Import:***\n\n```objc\n#import \u003cGHKit/GHKit.h\u003e\n```\n\n\n***Dates:***\n\n`GHNSDate+Formatters.h`: Date parsers, formatting and formatters for ISO8601, RFC822, HTTP (RFC1123, RFC850, asctime) and since epoch.\n\n```objc\nNSDate *date = [NSDate gh_parseISO8601:@\"2010-10-07T04:25Z\"];\nNSString *dateString = [date gh_formatHTTP]; // Formatted like: Sun, 06 Nov 1994 08:49:37 GMT\"\nNSDate *date = [NSDate gh_parseTimeSinceEpoch:@(1234567890)];\n```\n\n`GHNSDate+Utils.h`: For time ago in words and date component arithmentic (adding days), tomorrow, yesterday, and more.\n\n```objc\nNSDate *date = [NSDate date];\n[date gh_isToday]; // YES\n[[date gh_yesterday] gh_isToday]; // NO\n\ndate = [date gh_addDays:-1];\n[date gh_wasYesterday]; // YES\n\n[date gh_timeAgo:NO]; // @\"1 day\"\n```\n\n***Arrays:***\n\n`GHNSArray+Utils.h`: Random object, safe object at index, uniq, compact\n\n```objc\n[@[@(1), @(2), @(3)] gh_random]; // Random object\n[@[@(1), @(1), @(3)] gh_uniq]; // @[@(1), @(3)]\n[@[] gh_objectAtIndex:0]; // nil (Safe objectAtIndex)\n[@[@(1), NSNull.null] gh_compact]; // @[@(1)]\n```\n\n***Dictionaries:***\n\n`GHDictionary+Utils.h`:\n\n```objc\nNSDictionary *dict = @{@\"key1\": @(2), @\"key2\": @(3.1), @\"key3\": @YES};\nNSString *JSONString = [dict gh_toJSON:NSJSONWritingPrettyPrinted error:nil];\n```\n\n***Strings:***\n\n`GHNSString+Utils.h`: Stripping, reversing, counting and more.\n\n```objc\n[NSString gh_isBlank:@\"  \"]; // YES\n[NSString gh_isBlank:nil]; // YES\n[@\"  some text \" gh_strip]; // @\"some text\"\n[@\" \" gh_isPresent]; // NO\n[@\"abc\" gh_isPresent]; // YES\n[@\" \" gh_present]; // nil\n[@\"some text\" gh_present]; // @\"some text\"\n\n[@\"abc\" gh_reverse]; // @\"cba\"\n\n[@\"ababababcde\" gh_count:@\"ab\"]; // 4 (@\"ab\" appears 4 times)\n\n[NSString gh_localizedStringForTimeInterval:30]; // \"half a minute\"\n[NSString gh_abbreviatedStringForTimeInterval:30]; // @\"30s\"\n\n[@\"WWW.test.com\" gh_startsWith:@\"www.\" options:NSCaseInsensitiveSearch]; // YES\n[@\"foo:bar\" gh_lastSplitWithString:@\":\" options:NSCaseInsensitiveSearch]; // @\"bar\"\n\n[@\"e̊gâds\" gh_characters]; // @[@\"e̊\", @\"g\", @\"â\", @\"d\", @\"s\"];\n```\n\n***URLs:***\n\n`GHNSURL+Utils.h`: Encoding, escaping, parsing, splitting out or sorting query params, and more.\n\n```objc\nNSDictionary *dict = [@\"c=d\u0026a=b\" gh_queryStringToDictionary]; // Dictionary with a =\u003e b, c =\u003e d\n[NSDictionary gh_dictionaryToQueryString:dict sort:YES]; // @\"a=b\u0026c=d\"\n```\n\n***Colors:***\n\n`GHUIColor+Utils.h`: Colors from hex, color space changes, darken.\n\n```objc\nUIColor *color = GHUIColorFromRGB(0xBC1128);\nGH_HSV hsvColor = [color gh_hsv];\nUIColor *darkenedColor = [color gh_darkenColor:0.1]; // Darken 10%\n```\n\nAnd more...\n","funding_links":[],"categories":["etc"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabriel%2FGHKit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgabriel%2FGHKit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgabriel%2FGHKit/lists"}