Skip to content

Instantly share code, notes, and snippets.

@cenkbilgen
cenkbilgen / Origin.swift
Created March 12, 2019 17:38
A SceneKit node showing the world origin and axis directions. Helpful in ARKit, to know where exactly the session started and relative node locations.
//
// OriginAxis.swift
//
// Created by abc on 2019-03-07.
// Copyright © 2019 Cenk Bilgen. All rights reserved.
//
import Foundation
import SceneKit
@kouki-dan
kouki-dan / good-way.swift
Last active April 8, 2024 23:24
Swift UndoManager usage
import UIKit
class Counter {
let manager = UndoManager()
var count = 0
@objc func increment() {
count += 1
manager.registerUndo(withTarget: self, selector: #selector(Counter.decrement), object: nil)
}
@jspanos71
jspanos71 / OptiFine in MultiMC
Last active February 28, 2025 08:58
How to install OptiFine in MultiMC
The OptiFine installer requires that MC be installed in the default launcher and has opened the version of MC at least once. Do this first.
1. Download OptiFine
2. Extract OptiFine
a. Double click the download from step 1
b. Click Extract button
c. Navigate to MultiMC instance you wish to install OptiFine into (C:\mc\MultiMC\instances\1.13\.minecraft\)
3. Move extracted Optifine to instance \ libraries folder (C:\mc\MultiMC\instances\1.13\libraries\)
4. In MultiMC edit instance, go to Version screen and select the Minecraft entry in the list. Then click Add to Minecraft.jar
5. Select the OptiFine file you extracted and moved in step 3.
@CrystDragon
CrystDragon / MyTextLabel.swift
Created May 17, 2018 08:19
Most basic custom UITextInput conformance, without selection interaction, no UI elements but only pure texts.
import UIKit
class MyTextLabel: UIView {
var textLayer = CATextLayer()
var textStorage: String = "" {
didSet {
textLayer.string = textStorage
}
}
@pvieito
pvieito / gist:ee6d2c8934a8f84b9aeb467585277b8a
Last active June 23, 2025 03:22
Consumer keys of official Twitter clients

Twitter API Keys

Twitter for iPhone

Consumer key: IQKbtAYlXLripLGPWd0HUA
Consumer secret: GgDYlkSvaPxGxC4X8liwpUoqKwwr3lCADbz8A7ADU

Twitter for Android

Consumer key: 3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for Google TV

Consumer key: iAtYJ4HpUVfIUoNnif1DA

@dannote
dannote / final-cut-pro-trial-reset.swift
Last active August 21, 2025 11:47
Final Cut Pro X trial reset
#!/usr/bin/swift
// DISCLAIMER
// This script modifies an unencrypted file associated with the trial version of Final Cut Pro.
// Under the DMCA (17 U.S.C. § 1201), this modification does not qualify as circumvention of a technological
// protection measure (TPM), as it does not involve bypassing encryption, authentication, or similar protections.
// Distributing this code is therefore legal under the DMCA.
// This script is intended for educational and research purposes, such as exploring trial-related file structures,
@agiletortoise
agiletortoise / ViewController.swift
Created October 5, 2017 15:20
How to update input accessory view to handle iPhone X with external keyboard
//
// ViewController.swift
// TEST_InputViewX
//
// Created by Greg Pierce on 10/5/17.
// Copyright © 2017 Agile Tortoise. All rights reserved.
//
// Demonstrates how to update an input accessory view
// to work on iPhone X with external keyboard attached
// using safe area insets.
@EvieePy
EvieePy / error_handler.py
Last active July 7, 2025 05:48
Simple Error Handling for Prefix and App commands - discord.py
import logging
import discord
from discord import app_commands
from discord.ext import commands
LOGGER: logging.Logger = logging.getLogger(__name__)
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active September 1, 2025 15:33
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@tadija
tadija / FontNames-iOS-17.4.swift
Last active June 26, 2025 20:25
iOS - All Font Names
/*
*** Academy Engraved LET ***
AcademyEngravedLetPlain
---------------------
*** Al Nile ***
AlNile
AlNile-Bold
---------------------
*** American Typewriter ***
AmericanTypewriter