Skip to content

Instantly share code, notes, and snippets.

View 0xWDG's full-sized avatar
💻
Hacking my way around

Wesley de Groot 0xWDG

💻
Hacking my way around
View GitHub Profile
@0xWDG
0xWDG / PillButtons.swift
Created June 12, 2024 08:05 — forked from metasidd/PillButtons.swift
Pill Buttons - Mail App iOS 18 - SwiftUI
//
// PillButtons.swift
//
// Created by Siddhant Mehta on 6/11/24
// Twitter: @metasidd
//
// Feel free to reuse, or remix.
import SwiftUI
@0xWDG
0xWDG / LayoutThatFits.swift
Created June 9, 2022 09:00 — forked from ryanlintott/LayoutThatFits.swift
An alternative to ViewThatFits
//
// LayoutThatFits.swift
// WWDC22Experiments
//
// Created by Ryan Lintott on 2022-06-08.
//
import SwiftUI
struct LayoutThatFits: Layout {
@0xWDG
0xWDG / SecureLabel.swift
Created April 16, 2022 09:46 — forked from damian-rzeszot/SecureLabel.swift
_UITextLayoutCanvasView
import UIKit
lazy var hiddenView: UIView = {
let hiddenView: UIView
// iOS 14.1 -> _UITextFieldCanvasView
// iOS 15.0 -> _UITextLayoutCanvasView
if let klass = NSClassFromString("_UITextFieldCanvasView") as? UIView.Type {
hiddenView = klass.init()
@0xWDG
0xWDG / pdf_flatedecode.py
Created April 30, 2019 09:51 — forked from averagesecurityguy/pdf_flatedecode.py
Decompress FlateDecode Objects in PDF
#!/bin/bash
import re
import zlib
pdf = open("some_doc.pdf", "rb").read()
stream = re.compile(r'.*?FlateDecode.*?stream(.*?)endstream', re.S)
for s in stream.findall(pdf):
s = s.strip('\r\n')
try:
@0xWDG
0xWDG / sendPush.txt
Created November 21, 2018 14:55 — forked from valfer/sendPush.txt
Sending Push Notification with HTTP2 (and PHP) see entire post at: http://coding.tabasoft.it/ios/sending-push-notification-with-http2-and-php/
<?php
/**
* @param $http2ch the curl connection
* @param $http2_server the Apple server url
* @param $apple_cert the path to the certificate
* @param $app_bundle_id the app bundle id
* @param $message the payload to send (JSON)
* @param $token the token of the device
* @return mixed the status code (see https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/APNsProviderAPI.html#//apple_ref/doc/uid/TP40008194-CH101-SW18)
@0xWDG
0xWDG / addSizes.js
Created September 15, 2016 18:41 — forked from rainbowstudio/addSizes.js
Affichage du type et de la taille des documents pdf
function hdrDetails(index, elm, length, type) {
// divide the length into its largest unit
var units = [
[1024 * 1024 * 1024, 'Go'],
[1024 * 1024, 'Mo'],
[1024, 'Ko'],
[1, 'bytes']
];
for(var i = 0; i < units.length; i++){