Skip to content

Instantly share code, notes, and snippets.

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

Thiago Holanda unnamedd

🇺🇦
#StandWithUkraine
View GitHub Profile
@unnamedd
unnamedd / Parallaxable.swift
Created April 22, 2016 16:44 — forked from bbheck/Parallaxable.swift
Protocolo que permite que a UITableViewCell faça um efeito de parallax.
/**
Protocolo responsável por fazer o efeito de parallax nas imagens que, principalmente, são usadas como background.
É necessário chamar a função `setupParallaxInitialValues` no `awakeFromNib` da `UITableViewCell` para configurar os valores iniciais das variáveis.
Além disso, para total funcionamento do efeito, é necessário implementar algumas chamadas na `UIViewController` ou `UITableViewController` que a `tableView` está instanciada.
Chamar a função `setParallaxCellImageOffsetWithTableView` no `willDisplayCell` da `UITableViewDelegate` e para todas as células visíveis no método `scrollViewDidScroll`.
Implementação:
@unnamedd
unnamedd / CreditCard.swift
Last active August 30, 2016 06:44 — forked from cwagdev/CreditCard.swift
Credit Cards represented in Swift
//
// Created by Chris Wagner
// https://gist.github.com/cwagdev/e66d4806c1f63fe9387a
//
// Modified by Thiago Holanda (August/2016)
//
// These modifications was made to support the latest version of Swift
// before the major version (3.0) is released. This code will compile
// without any problem on Swift 2.2.
//
@unnamedd
unnamedd / FTDI_Basic_Hookup_for_ESP-01.jpg
Created December 19, 2017 00:44 — forked from stonehippo/FTDI_Basic_Hookup_for_ESP-01.jpg
Notes on using the ESP8266 with the Arduino IDE
FTDI_Basic_Hookup_for_ESP-01.jpg
@unnamedd
unnamedd / Twitter API with Curl
Created March 30, 2018 17:28 — forked from apolloclark/Twitter API with Curl
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"
@unnamedd
unnamedd / 00-about-search-api-examples.md
Created April 19, 2018 14:29 — forked from jasonrudolph/00-about-search-api-examples.md
5 entertaining things you can find with the GitHub Search API
@unnamedd
unnamedd / byobuCommands
Created May 25, 2018 23:07 — forked from jshaw/byobuCommands
Byobu Commands
Byobu Commands
==============
byobu Screen manager
Level 0 Commands (Quick Start)
------------------------------
<F2> Create a new window
@unnamedd
unnamedd / NotificationTestCase.swift
Created October 25, 2018 21:34 — forked from fxm90/NotificationTestCase.swift
XCTest - Assert notification (not) triggered.
import XCTest
class NotificationTestCase: XCTestCase {
func testTriggerNotification() {
expectation(forNotification: .fooBar,
object: nil,
handler: nil)
let notificationCenter = NotificationCenter.default
@unnamedd
unnamedd / Sequence+GroupByDate.swift
Created October 26, 2018 17:05 — forked from ElegyD/Sequence+GroupByDate.swift
Group a Swift Model by date with auto sorting and asc/desc support (Swift 3) E.g.: for a UITableView with sections
extension Sequence {
func groupSort(ascending: Bool = true, byDate dateKey: (Iterator.Element) -> Date) -> [[Iterator.Element]] {
var categories: [[Iterator.Element]] = []
for element in self {
let key = dateKey(element)
guard let dayIndex = categories.index(where: { $0.contains(where: { Calendar.current.isDate(dateKey($0), inSameDayAs: key) }) }) else {
guard let nextIndex = categories.index(where: { $0.contains(where: { dateKey($0).compare(key) == (ascending ? .orderedDescending : .orderedAscending) }) }) else {
categories.append([element])
continue
}
@unnamedd
unnamedd / mac-apps.md
Created December 4, 2018 10:05 — forked from erikreagan/mac-apps.md
Mac developer must-haves

Mac web developer apps

This gist's comment stream is a collection of webdev apps for OS X. Feel free to add links to apps you like, just make sure you add some context to what it does — either from the creator's website or your own thoughts.

— Erik

@unnamedd
unnamedd / README.md
Created June 14, 2017 17:15 — forked from acrookston/README.md
Xcode pre-action to build custom Info.plist

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of preaction.sh into the pre-action script box.