Skip to content

Instantly share code, notes, and snippets.

@jinthagerman
jinthagerman / DateHelpers.swift
Created February 26, 2017 10:26
Time ago/ahead in Swift
import Foundation
struct DateComponentUnitFormatter {
private struct DateComponentUnitFormat {
let unit: Calendar.Component
let singularUnit: String
let pluralUnit: String
@calvinfroedge
calvinfroedge / languages.json
Created March 30, 2015 02:03
JSON list of all programming languages
"["A# .NET","A# (Axiom)","A-0 System","A+","A++","ABAP","ABC","ABC ALGOL","ABLE","ABSET","ABSYS","ACC","Accent","Ace DASL","ACL2","ACT-III","Action!","ActionScript","Ada","Adenine","Agda","Agilent VEE","Agora","AIMMS","Alef","ALF","ALGOL 58","ALGOL 60","ALGOL 68","ALGOL W","Alice","Alma-0","AmbientTalk","Amiga E","AMOS","AMPL","APL","App Inventor for Android's visual block language","AppleScript","Arc","ARexx","Argus","AspectJ","Assembly language","ATS","Ateji PX","AutoHotkey","Autocoder","AutoIt","AutoLISP / Visual LISP","Averest","AWK","Axum","B","Babbage","Bash","BASIC","bc","BCPL","BeanShell","Batch (Windows/Dos)","Bertrand","BETA","Bigwig","Bistro","BitC","BLISS","Blue","Bon","Boo","Boomerang","Bourne shell","bash","ksh","BREW","BPEL","C","C--","C++","C#","C/AL","Caché ObjectScript","C Shell","Caml","Candle","Cayenne","CDuce","Cecil","Cel","Cesil","Ceylon","CFEngine","CFML","Cg","Ch","Chapel","CHAIN","Charity","Charm","Chef","CHILL","CHIP-8","chomski","ChucK","CICS","Cilk","CL","Claire","Clarion","Clean"
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active May 29, 2024 07:33
The best FRP iOS resources.

Videos

@Tantas
Tantas / SKTexture+Gradient.h
Last active July 19, 2022 09:59
Creates a SKTexture programatically with a vertical gradient.
#import <SpriteKit/SpriteKit.h>
@interface SKTexture (Gradient)
/** Creates a SKTexture programatically with a vertical gradient.
Great suggestion for colors: http://ios7colors.com/.
Example:
(Inside a SKScene class)
@jmont
jmont / maybe.m
Last active March 30, 2016 16:27
Swift Monads
// Swift Monads -- Maybe
// Juan C. Montemayor (@norsemelon)
// This operator can be used to chain Optional types like so:
// optionalVal >>= f1 >>= f2
// where f1 and f2 have type `Any -> Any?`
//
// If a value is ever nil, the chain short-circuits and will result in nil.
// This is a much neater way to do this than using the if syntax specified in
// the Swift iBook.
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active May 17, 2024 02:53
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@kylefox
kylefox / color.m
Created January 27, 2012 17:45
Generate a random color (UIColor) in Objective-C
/*
Distributed under The MIT License:
http://opensource.org/licenses/mit-license.php
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
@alex-cellcity
alex-cellcity / Version.m
Created May 30, 2011 04:55
Runtime iOS Version Checking
/*
* System Versioning Preprocessor Macros
*/
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)