Skip to content

Instantly share code, notes, and snippets.

View gu3st's full-sized avatar
🥃
Just gotta get through this week

Dustin Dawes gu3st

🥃
Just gotta get through this week
View GitHub Profile
@dduan
dduan / SwiftChartPong.swift
Last active May 30, 2024 11:20
Pong Game implemented with Swift Charts.
import SwiftUI
import Charts
import Combine
import Foundation
final class GameState: ObservableObject {
struct Player {
var position: Int
var halfSize: Int = 150
@nims11
nims11 / d2_summarize_enemy.py
Created September 26, 2018 16:26
[Dota2] Helps you ban heroes by summarizing past games of the enemy
# Change the variables MY_ID and SERVER_FILE_PATH, and run this file
# The summary will be generated as soon as a game starts
import sys
import time
import os
import re
import requests
from multiprocessing import Pool
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler
@developit
developit / *valoo.md
Last active November 13, 2023 08:39
🐻 Valoo: just the bare necessities of state management. 150b / 120b. https://npm.im/valoo

🐻 valoo

just the bare necessities of state management.

Usage

Hotlink it from https://unpkg.com/valoo.

See Interactive Codepen Demo.

@mattgallagher
mattgallagher / ViewModel-ViewBinding.swift
Last active March 26, 2017 10:56
An abstract look at the View-Model/View-Binding pattern I frequently use in my projects and why this pattern uses the Swift `private` keyword.
// This file is an abstract representation of code that I use extensively in my apps
// for constructing and maintaining views. The reason the `private` keyword is used here
// is to control the interface between two entities (a function and a class) which typically
// reside in the same file.
//
// The function and the class implement a View-Binding and a View-Model. The two are largely
// representations of the *same* concepts – the latter from data perspective and the former
// from a view-infrastructure perspective. Their inter-relatedness makes it highly desirable to
// place them both in the same file – they may share many small types between them and they
// are perpetually co-evolving.
@steventroughtonsmith
steventroughtonsmith / gist:52f0c6783446b6fc536e
Created January 17, 2016 06:49
NSExtensionSDK providers
AddressBookUI.framework
(
"com.apple.people-picker"
)
AudioToolbox.framework
(
"com.apple.AudioUnit",
"com.apple.AudioUnit-UI"
@steventroughtonsmith
steventroughtonsmith / FileBrowser.py
Created January 14, 2016 22:18
File Browser for Pythonista
# coding: utf-8
from UIKit import *
from Foundation import *
from ctypes import *
libobjc = CDLL('/usr/lib/libobjc.dylib')
QLPreviewController = ObjCClass('QLPreviewController')
@indragiek
indragiek / CStringArray.swift
Last active November 14, 2019 02:03
Helper for working with char ** in Swift
// Copyright © 2015 Indragie Karunaratne. All rights reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
@BigZaphod
BigZaphod / Pathfinding.swift
Created November 24, 2015 17:33
AStar pathfinding in Swift
// uses PriorityQueue from https://github.com/mauriciosantos/Buckets-Swift
protocol Pathfinding {
typealias Node: Hashable
func neighborsFor(node: Node) -> [Node]
func costFrom(from: Node, to: Node) -> Int
func heuristicFrom(from: Node, to: Node) -> Int
}
@steventroughtonsmith
steventroughtonsmith / Tweak.xm
Created October 14, 2015 06:33
iOS 9 Enable Splitscreen Jailbreak Tweak (Theos)
/* How to Hook with Logos
Hooks are written with syntax similar to that of an Objective-C @implementation.
You don't need to #include <substrate.h>, it will be done automatically, as will
the generation of a class list and an automatic constructor.
%hook ClassName
// Hooking a class method
+ (id)sharedInstance {
@alanzeino
alanzeino / lldb-debugging.md
Last active May 29, 2024 03:18
LLDB debugging with examples

LLDB Debugging Cheat Sheet

Commands

LLDB Commands

LLDB comes with a great set of commands for powerful debugging.

help

Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help for more information on a command. Type help to get help for a specific option in a command too.