Skip to content

Instantly share code, notes, and snippets.

View kinwahlai's full-sized avatar

KinWah Lai kinwahlai

  • Odd-e Singapore
  • Singapore
View GitHub Profile
@marccarre
marccarre / list_kindle_releases.py
Created October 24, 2020 08:46
List all available versions of Kindle for Mac and Kindle for PC.
#!/usr/bin/env python
'''
List all available versions of Kindle for Mac and Kindle for PC.
Dependencies:
- asyncio==3.4.3
- aiohttp==3.6.3
'''
import os
import sys
@danielmartin
danielmartin / XcodeNewBuildSystemSettings.json
Created February 23, 2020 14:37
Complete list of Xcode new build system settings and their documentation in JSON format.
This file has been truncated, but you can view the full file.
[
{
"spec": "com.apple.compilers.metal",
"path": "/Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/Metal.xcplugin/Contents/Resources/Metal Compiler.xcspec",
"options": [
{
"name": "CLANG_DIAGNOSTICS_FILE"
},
{
"name": "MTLCOMPILER_DEPENDENCY_INFO_FILE"
@AvdLee
AvdLee / DarwinNotificationCenter.swift
Last active November 1, 2024 11:56
A notification center for Darwin Notifications. MIT License applies.
//
// DarwinNotificationCenter.swift
//
// Copyright © 2017 WeTransfer. All rights reserved.
//
import Foundation
/// A Darwin notification payload. It does not contain any userInfo, a Darwin notification is purely event handling.
public struct DarwinNotification {
@VarunBarad
VarunBarad / git-backup.py
Created March 3, 2019 10:33
Script to create a single-file backup of a git repository
#!/usr/bin/python3
import os
import sys
import re
import shutil
from git import Repo
from zipfile import ZipFile
def create_backup_zip(directory_to_backup):
@Log1x
Log1x / debloatNox.md
Last active November 16, 2024 20:49
Debloating & Optimizing Nox

Debloating Nox

Nox, despite being the most feature-filled Android emulator, has a lot of negativity surrounding it due to their antics when it comes to making income off of their program. It is known for running repeated advertisments in the background, calling home and passing along system information (outside of your Android instance) as well as a vast amount of potentially sensitive data in an encrypted payload back to their multitude of servers. With the following preventitive measures, we can stop a majority of this happening as well as greatly improve the overall performance.

  1. Download and Install a fresh copy of Nox. The latest version is fine (for now). If you already have it installed, that is fine too. No need to reinstall.

  2. Enable Root Mode on Nox by clicking the gear icon and then checking the Root Startup box.

  3. Install a new Launcher from the Play Store. ANYTHING but Nox's default. I suggest [Nova Launcher](https://play.google.com/s

Enable macOS Server Performance Mode

Performance mode changes the system parameters of your Mac. These changes take better advantage of your hardware for demanding server applications.

A Mac with macOS Server that needs to run high-performance services can turn on performance mode to dedicate additional system resources for server applications. Note, however, that performance mode can be enabled even without macOS Server being installed to achieve similar benifits for other high-performance services.

sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)"
sudo reboot

Reference: https://support.apple.com/en-us/HT202528.

@AvdLee
AvdLee / XCTestCaseExtensions.swift
Last active June 7, 2023 07:28
This extension should make it fairly easy to test your Share Extension. Read more about it here: https://www.avanderlee.com/swift/ui-test-share-extension/
//
// XCTestCaseExtensions.swift
//
// Useful extension to UI Test the Share Extension of apps.
//
//
// Created by Antoine van der Lee on 18/05/2018.
// Copyright © 2018. All rights reserved.
//
@AndreiCalazans
AndreiCalazans / airlines.json
Last active September 20, 2024 18:53
List of Airlines 2 letter code
{
"U2": "easyjet",
"1T": "Bulgarian Air Charter",
"Q5": "40-Mile Air",
"4O": "Interjet",
"7A": "Express Air Cargo",
"JY": "Air Turks and Caicos",
"JU": "Air Serbia",
"QH": "Kyrgyzstan",
"A8": "Benin Golf Air",
@NikhilManapure
NikhilManapure / Gif.swift
Last active October 29, 2023 07:31
Create Gif from array of UIImages in Swift 3
import Foundation
import UIKit
import ImageIO
import MobileCoreServices
extension UIImage {
static func animatedGif(from images: [UIImage]) {
let fileProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [kCGImagePropertyGIFLoopCount as String: 0]] as CFDictionary
let frameProperties: CFDictionary = [kCGImagePropertyGIFDictionary as String: [(kCGImagePropertyGIFDelayTime as String): 1.0]] as CFDictionary
@lattner
lattner / TaskConcurrencyManifesto.md
Last active November 18, 2024 17:28
Swift Concurrency Manifesto