Skip to content

Instantly share code, notes, and snippets.

View hectorddmx's full-sized avatar

Hector De Diego hectorddmx

View GitHub Profile
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active November 7, 2025 04:26
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ddunbar
ddunbar / xcbuild-debugging-tricks.md
Last active May 7, 2025 03:45
Xcode new build system debugging tricks

New Build System Tricks

Command Line

alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
# THIS DOESNT WORK YET: xcbuild openIDEConsole  # … then switch to Xcode ➡️
xcbuild showSpecs
xcbuild build <foo.pif> [—target <target>]
@agentcooper
agentcooper / 0.README.md
Last active May 15, 2025 05:56
Telegram chat backup/export

How to use

  1. Login to https://web.telegram.org
  2. Copy-paste contents of telegram-scripts.js into JS console
  3. Run showContacts() to get the list of contacts with ids
  4. Run saveChat(userId) where userId is the id from step 3

Process can take a while, check console for progress. Occasionall FLOOD_WAIT errors are expected. Once done, browser will download the JSON file.

Motivation

@IanKeen
IanKeen / GenericTableViewCell.swift
Last active July 17, 2022 14:07
A simple generic tableview cell
import UIKit
/// A UITableViewCell that loads a custom UIView into its .contentView
/// the typed view can be accessed via the .customView property
open class GenericTableViewCell<View: UIView>: UITableViewCell {
// MARK: - Properties
public let customView = View()
// MARK: - Lifecycle
public override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
@namannik
namannik / MGLMapView+MBTiles.swift
Last active December 4, 2024 10:27
MGLMapView+MBTiles
import Foundation
import Mapbox
import SQLite
// MARK: MbtilesSource
enum MBTilesSourceError: Error {
case CouldNotReadFileError
case UnknownFormatError
case UnsupportedFormatError
@jellybeansoup
jellybeansoup / AppDelegate.swift
Created January 23, 2018 05:39
Preloading App Data for Screenshots
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
prepareForTestingUI()
// Handle the actual launch of your application
}
private func prepareForTestingUI() {
guard let contentsURL = Bundle.main.url(forResource: "UITests", withExtension: "xcappdata")?.appendingPathComponent("AppData") else {
return
}
@grossbart
grossbart / nix.md
Last active February 28, 2025 04:15
Nix on macOS

Nix

Nix is a powerful package manager that makes package management reliable and reproducible. It provides atomic upgrades and rollbacks, side-by-side installation of multiple versions of a package, multi-user package management and easy setup of build environments.

Installation

@typebrook
typebrook / MBTilesServer.kt
Last active March 18, 2025 05:50
How to make MBTiles valid on Mapbox Android SDK #mbtiles #android #mapbox
package com.example.sample.offline
import android.util.Log
import java.io.BufferedReader
import java.io.ByteArrayOutputStream
import java.io.FileNotFoundException
import java.io.PrintStream
import java.net.ServerSocket
import java.net.Socket
import kotlin.math.pow
@StanDimitroff
StanDimitroff / UIImage+CIPerspectiveCorrection.swift
Last active December 31, 2024 03:08
Image perspective correction
extension UIImage {
var flattened: UIImage? {
let ciImage = CIImage(image: self)!
guard let openGLContext = EAGLContext(api: .openGLES2) else { return nil }
let ciContext = CIContext(eaglContext: openGLContext)
let detector = CIDetector(ofType: CIDetectorTypeRectangle,
context: ciContext,
options: [CIDetectorAccuracy: CIDetectorAccuracyHigh])!
@d-date
d-date / UIActivityType+PopularServices.swift
Created March 14, 2018 10:08
Share extension for popular apps
private extension UIActivityType {
static let postToLINE = UIActivityType("jp.naver.line.Share")
static let gmail = UIActivityType("com.google.Gmail.ShareExtension")
static let postToSlack = UIActivityType("com.tinyspeck.chatlyio.share")
static let facebookMessanger = UIActivityType("com.facebook.Messenger.ShareExtension")
static let tweetbot4 = UIActivityType("com.tapbots.Tweetbot4.shareextension")
static let evernote = UIActivityType("com.evernote.iPhone.Evernote.EvernoteShare")
static let bear = UIActivityType("net.shinyfrog.bear-iOS.Bear-iPhone-Sharing-Extension")
}