Skip to content

Instantly share code, notes, and snippets.

View codyd51's full-sized avatar

Phillip Tennen codyd51

View GitHub Profile
@iexa
iexa / python-with-tcl.rb
Last active July 20, 2021 05:35
MacOS homebrew python 3.8.6 with tcl-tk (properly)
class Python < Formula
desc "Interpreted, interactive, object-oriented programming language"
homepage "https://www.python.org/"
url "https://www.python.org/ftp/python/3.8.6/Python-3.8.6.tar.xz"
sha256 "a9e0b79d27aa056eb9cce8d63a427b5f9bab1465dee3f942dcfdb25a82f4ab8a"
head "https://github.com/python/cpython.git"
license "Python-2.0"
revision 1
bottle do
@uroboro
uroboro / iOS Exploits.md
Last active September 1, 2022 08:36
List of interesting things to break iOS with
@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 {

#Loading Tweaks in the Simulator

With the latest updates to the simulator, this turns out to be pretty simple:

You need to be using kirb/theos

In order not to require MobileSubstrate to be loaded and your tweak to be compiled for i386/x86_64, add

In your makefile:

@barosl
barosl / add.c
Created July 26, 2015 07:26
Function overloading in C
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int addi(int a, int b) {
return a + b;
}
char *adds(char *a, char *b) {
char *res = malloc(strlen(a) + strlen(b) + 1);
@ianb821
ianb821 / Screenshot
Created November 25, 2014 02:00
Grabbing Screenshot on Lock
To get the background I use _UICreateScreenUIImage();
Here's the declaration:
OBJC_EXTERN UIImage *_UICreateScreenUIImage(void) NS_RETURNS_RETAINED;
Specifically I hook SBBackLightController. Here is the bare bones of what I use:
%hook SBBacklightController
- (void)animateBacklightToFactor:(CGFloat)factor duration:(double)duration source:(int)source completion:(void (^)(void))completion {
if (factor < 0.1) {
UIImage *currentBackground = _UICreateScreenUIImage();
@kylehowells
kylehowells / gist:9aeb36ea211f65c823d7
Created August 6, 2014 03:35
My best understanding of how SpringBoard manages its SBGestureRecognizers
//SpringBoard
-(void)_reloadDemoAndDebuggingDefaultsAndCapabilities{
//..Blah blah, setting stuff up, etc.., etc...
// Control Centre gesture
SBOffscreenSwipeGestureRecognizer *gesture = [[SBOffscreenSwipeGestureRecognizer alloc] initForOffscreenEdge:0x4];
[gesture setTypes:0x40];
[gesture setShouldUseUIKitHeuristics:YES];
@tsiege
tsiege / The Technical Interview Cheat Sheet.md
Last active May 5, 2024 04:52
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

ANNOUNCEMENT

I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!






\

@jboner
jboner / latency.txt
Last active May 5, 2024 03:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@xslim
xslim / gist:1029343
Created June 16, 2011 14:35
MPMusicPlayerController snippets
- (void)setupiPodPlayer;
{
if (!self.ipodPlayer) {
self.ipodPlayer = [MPMusicPlayerController iPodMusicPlayer];
// Register for music player notifications
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[notificationCenter addObserver:self
selector:@selector(handleNowPlayingItemChanged:)