Skip to content

Instantly share code, notes, and snippets.

View unnamedd's full-sized avatar
🇺🇦
#StandWithUkraine

Thiago Holanda unnamedd

🇺🇦
#StandWithUkraine
View GitHub Profile
@radex
radex / NSTimer.md
Last active May 30, 2018 10:33
Swift Extensions: NSTimer

NSTimer is a great example of an over-verbose, outdated Objective-C API. To run a simple line of code after a delay, you need to write a lot of boilerplate crap.

How about this:

NSTimer.schedule(5.seconds) {
  println("Hello world!")
}
@chriseidhof
chriseidhof / routes.swift
Created August 17, 2014 21:04
Type-safe routes in Swift
//
// main.swift
// Routes
//
// Created by Chris Eidhof on 17/08/14.
// Copyright (c) 2014 Chris Eidhof. All rights reserved.
//
import Foundation
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 20, 2025 21:15
The best FRP iOS resources.

Videos

@eatonphil
eatonphil / functions.c
Last active April 3, 2025 13:21
Introduction to "Fun" C (using GCC)
/**
* This are a collection of examples for C 201.
* These combine concepts you may or may not be
* familiar with and are especially useful for
* students new to C. There is a lot of really
* cool stuff you can do in C without any cool
* languages.
*
* This is file in particular is an introduction
* to fun function usage in C.
@raphaelhanneken
raphaelhanneken / NSImageExtensions.swift
Last active March 6, 2025 23:01
NSImage extensions for easy resizing, cropping and saving png images.
//
// NSImageExtensions.swift
//
import Cocoa
extension NSImage {
/// The height of the image.
var height: CGFloat {
// post a description of the object we want using graphql, this
// is then looped over and then each node that is registered checks
// and returns a json copy of the requested fields
package main
import (
"errors"
"log"
"reflect"
"sevki.org/graphql/parse"
@DougFischer
DougFischer / XCodeTurnTODOandFIXMEintoWarnings.sh
Last active September 9, 2016 21:58
Put this code as post build script on XCode to turn TODO, NOT_IMPLEMENTED and FIXME into XCode warnings.
KEYWORDS="TODO|NOT_IMPLEMENTED|FIXME|\?\?\?:|\!\!\!:"
find "${SRCROOT}" \( -name "*.h" -or -name "*.m" \) -and \( -path "${SRCROOT}/Pods/*" -prune -o -print0 \) | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/"
@thesoftwarejedi
thesoftwarejedi / clear-old-slack.py
Last active December 19, 2023 12:02
delete old slack files
import requests
import json
import calendar
from datetime import datetime, timedelta
#token from https://api.slack.com/web
_token = "YOUR TOKEN HERE"
_domain = "YOUR SUB DOMAIN HERE"
if __name__ == '__main__':
@apolloclark
apolloclark / Twitter API with Curl
Last active December 15, 2024 00:46
Twitter API with Curl
# create an account, create an app
# @see https://apps.twitter.com/
# retrieve the access tokens
# @see https://dev.twitter.com/oauth/reference/post/oauth2/token
# create the file ~/twitter_api
nano ~/twitter_api
Authorization: OAuth oauth_consumer_key="XXXXXX", oauth_nonce="11111111", oauth_signature="XXXXXX", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1450728725", oauth_token="99999-XXXXXX", oauth_version="1.0"
@zacwest
zacwest / ios-font-sizes.swift
Last active April 24, 2025 07:18
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]