Skip to content

Instantly share code, notes, and snippets.

@nitrag
nitrag / Screenshot.swift
Created November 21, 2016 05:16
This will allow you to take a screenshot of a UIView, but more importantly only a section of that view
//
// Screenshot.swift
//
// 1) Take a picture of a UIView
// 2) Take a picture of a UIView's subframe. EG. Fullscreen UIView with a
// small square box in the middle, it will only save what's visible in the box frame
// but not the box itself
import Foundation
import UIKit
@pudquick
pudquick / nibbler.py
Last active February 16, 2023 06:07
nibbler - Use .nib files with python to quickly make UIs
# OFFICIAL REPO: https://github.com/pudquick/nibbler
# (this gist will be preserved for historical purposes)
# demo video here:
# https://www.dropbox.com/s/k0bpekd13muknmz/nibbler%20-%20by%20frogor.mp4?dl=0
# Example script using nibbler:
# from nibbler import *
#
@jkereako
jkereako / PrintDataAsString.swift
Last active April 17, 2024 22:07
LLDB commands to print a Data object as a String. It only works if the underlying data is actually a String.
// See: http://stackoverflow.com/questions/11531353/viewing-nsdata-contents-in-xcode#25097265
po String(data: data, encoding: .utf8)
// Objective-C equivalent.
// See: http://stackoverflow.com/questions/11531353/viewing-nsdata-contents-in-xcode#19626815
// p (char *)[buffer bytes]
@pudquick
pudquick / unsign_plist.py
Created January 17, 2016 04:05
Getting an unsigned plist / mobileconfig from a signed one in python on OS X with pyObjC
import objc
from Foundation import NSBundle
Security_bundle = NSBundle.bundleWithIdentifier_('com.apple.security')
CMSDecoderRef = objc.createOpaquePointerType("CMSDecoderRef", b"^{CMSDecoder}", None)
functions = [('CMSDecoderCreate', b'io^^{CMSDecoder}'),
('CMSDecoderUpdateMessage', b'i^{CMSDecoder}*I'),
('CMSDecoderFinalizeMessage', b'i^{CMSDecoder}',),
@rtrouton
rtrouton / cipher.sh
Last active January 14, 2016 20:45 — forked from opragel/cipher.sh
#!/bin/bash
# Add the user and group used by Tomcat on your Linux
# server. For Casper 9.x running on Red Hat Enterprise
# Linux, the user and group are filled in below.
linux_tomcat_user="tomcat7"
linux_tomcat_group="tomcat7"
# Add the user and group used by Tomcat on your Linux