Skip to content

Instantly share code, notes, and snippets.

View daydreamboy's full-sized avatar
🎯
Focusing

daydreamboy

🎯
Focusing
View GitHub Profile
@daydreamboy
daydreamboy / PhotosCameraRoll.m
Created June 4, 2025 05:54 — forked from Koze/PhotosCameraRoll.m
Getting Camera Roll with Photos.framework
PHFetchResult *result = [PHAssetCollection fetchAssetCollectionsWithType:PHAssetCollectionTypeSmartAlbum
subtype:PHAssetCollectionSubtypeSmartAlbumUserLibrary
options:nil];
PHAssetCollection *assetCollection = result.firstObject;
NSLog(@"%@", assetCollection.localizedTitle);
// Camera Roll
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ConsentText</key>
<dict>
<key>default</key>
<string>Created with webClip</string>
</dict>
<key>PayloadContent</key>
<array>
@daydreamboy
daydreamboy / magic_bytes.json
Created April 7, 2025 01:21 — forked from neutrinoguy/magic_bytes.json
File Signatures with there magic bytes.
{'ascii': '....',
'description': 'RedHat Package Manager (RPM) package',
'file_extension': 'rpm',
'hex': 'ed ab ee db',
'offset': '0'},
{'ascii': 'SP01',
'description': 'Amazon Kindle Update Package',
'file_extension': 'bin',
'hex': '53 50 30 31',
'offset': '0'},
@daydreamboy
daydreamboy / bash-colors.md
Created March 29, 2025 07:38 — forked from iamnewton/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@daydreamboy
daydreamboy / UIDevice+serialNumber.h
Created March 21, 2025 02:27 — forked from 0xced/UIDevice+serialNumber.h
UIDevice+serialNumber
/*
* Adds the serialNumber property to the UIDevice class
*
* The implementation uses undocumented (for iOS) IOKit functions,
* so handle with caution and be prepared for nil.
*/
#import <UIKit/UIDevice.h>
@interface UIDevice (serialNumber)
@daydreamboy
daydreamboy / symbolicate.rb
Created November 5, 2024 06:29 — forked from dceddia/symbolicate.rb
Symbolicate a macOS crash report from Sentry
#!/usr/bin/env ruby
# colorization without needing a gem
class String
def colorize(color_code)
"\e[#{color_code}m#{self}\e[0m"
end
def red
colorize(31)
@daydreamboy
daydreamboy / gist:c5fc0ff41f3b5af56fe5a33d3ec94ae4
Created August 31, 2024 13:44 — forked from rais38/gist:4758465
Detect If Your Application Is Running In The Debugger
static bool debuggerRunning(void) {
int junk;
int mib[4];
struct kinfo_proc info;
size_t size;
info.kp_proc.p_flag = 0;
mib[0] = CTL_KERN;
mib[1] = KERN_PROC;
@daydreamboy
daydreamboy / ptrace-exmaple.c
Created August 31, 2024 13:31 — forked from camillobruni/ptrace-exmaple.c
A little example showing how ptrace works under OSX
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/ptrace.h>
#include <unistd.h>
int main(int argc, char *argv[])
{
int target_pid;
long ret;
@daydreamboy
daydreamboy / curl.md
Created August 27, 2024 03:45 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@daydreamboy
daydreamboy / UIApplication+Environment.swift
Created May 14, 2024 07:57 — forked from SergLam/UIApplication+Environment.swift
Swift - check iOS app environment (debug OR TestFlight build) at runtime
import UIKit
extension UIApplication {
// MARK: Public
func isRunningInTestFlightEnvironment() -> Bool {
if isSimulator() {
return false
} else {
if isAppStoreReceiptSandbox() && !hasEmbeddedMobileProvision() {