Skip to content

Instantly share code, notes, and snippets.

View yo1995's full-sized avatar
🤞
Everybody finds somebody someplace

Ting yo1995

🤞
Everybody finds somebody someplace
  • Redlands, CA
  • 01:40 (UTC -07:00)
View GitHub Profile
@nixta
nixta / Bundle+ArcGISRuntimeSDKVersion.swift
Created September 2, 2020 16:56
Read and output ArcGIS Runtime SDK version text.
extension Bundle {
private static let agsBundle = AGSBundle()
/// An end-user printable string representation of the ArcGIS Bundle version shipped with the app.
///
/// For example, "2883"
static var sdkBundleVersion: String {
return (agsBundle?.object(forInfoDictionaryKey: "CFBundleVersion") as? String) ?? "?"
@Azoy
Azoy / syscall.swift
Last active August 25, 2023 21:49
Raw system calls in Swift
// macOS x86_64 syscall works as follows:
// Syscall id is moved into rax
// 1st argument is moved into rdi
// 2nd argument is moved into rsi
// 3rd argument is moved into rdx
// ... plus some more
// Return value is stored in rax (where we put syscall value)
// Mac syscall enum that contains the value to correctly call it
enum Syscall: Int {
@miguelmota
miguelmota / remove_tuxera.sh
Last active April 3, 2024 08:41
Completely uninstall and remove Tuxera NTFS on MacOS (resets trial version)
sudo rm -rf /Applications/Tuxera\ Disk\ Manager.app
sudo rm -rf /Library/Application\ Support/Tuxera\ NTFS
sudo rm -rf /Library/Filesystems/fusefs_txantfs.fs
@Nirma
Nirma / FTPUpload.swift
Last active December 30, 2023 02:11
Upload a file via FTP on iOS or macOS
import Foundation
import CFNetwork
public class FTPUpload {
fileprivate let ftpBaseUrl: String
fileprivate let directoryPath: String
fileprivate let username: String
fileprivate let password: String
@MoOx
MoOx / index.js
Last active February 9, 2024 22:44
Export/import github labels
// go on you labels pages
// eg https://github.com/cssnext/cssnext/labels
// paste this script in your console
// copy the output and now you can import it using https://github.com/popomore/github-labels !
var labels = [];
[].slice.call(document.querySelectorAll(".label-link"))
.forEach(function(element) {
labels.push({
name: element.textContent.trim(),
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule
@ZevEisenberg
ZevEisenberg / resetAllSimulators.sh
Last active November 30, 2022 09:27
Reset all iOS simulators with this one weird trick
osascript -e 'tell application "iOS Simulator" to quit'
osascript -e 'tell application "Simulator" to quit'
xcrun simctl erase all
@jexchan
jexchan / multiple_ssh_setting.md
Created April 10, 2012 15:00
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"