Skip to content

Instantly share code, notes, and snippets.

View dcramps's full-sized avatar
💁‍♂️
you're a towel

dc dcramps

💁‍♂️
you're a towel
View GitHub Profile
@dcramps
dcramps / gifomatic.sh
Created August 12, 2020 21:56
Make a gif from an iOS simulator with this one weird trick.
#!/bin/bash
FILENAME=$1
TEMPDIR="/Users/dc/Documents/GIFs/temp"
SAVEDIR="/Users/dc/Documents/GIFs"
trap trapsigint INT
function trapsigint {
echo -e "\nMaking $FILENAME.gif"
@dcramps
dcramps / AnimationThing.swift
Last active July 30, 2019 10:31
Animation stuff
import UIKit
class AnimationThing: UIViewController {
let toolbar = UIView()
let doAThing = Notification.Name(rawValue: "DoAThing")
override func viewDidLoad() {
super.viewDidLoad()
@dcramps
dcramps / KeyboardThing.swift
Last active July 30, 2019 15:40
Keyboard stuff
import UIKit
class KeyboardThing: UIViewController {
let toolbar = UIView()
let input = UITextField()
override func viewDidLoad() {
super.viewDidLoad()
@dcramps
dcramps / fetch.sh
Last active May 4, 2019 00:07
PAK fetch for UTPugs
#!/bin/bash
FORCE=0
NOCOPY=0
while getopts "f" OPTION; do
case $OPTION in
f)
FORCE=1
;;
@dcramps
dcramps / out.txt
Created April 28, 2019 08:25
ldd output
dc@dc:~/utroot/LinuxServer/UnrealTournament/Binaries/Linux$ ldd libUE4Server-MutatorStatsRecord-Linux-Shipping.so
linux-vdso.so.1 (0x00007ffcd8077000)
libpq.so.5 => /home/dc/utroot/LinuxServer/UnrealTournament/Binaries/Linux/./libpq.so.5 (0x00007f1187e9e000)
libUE4Server-Core-Linux-Shipping.so => /home/dc/utroot/LinuxServer/UnrealTournament/Binaries/Linux/./../../../Engine/Binaries/Linux/libUE4Server-Core-Linux-Shipping.so (0x00007f11875bd000)
libUE4Server-CoreUObject-Linux-Shipping.so => /home/dc/utroot/LinuxServer/UnrealTournament/Binaries/Linux/./../../../Engine/Binaries/Linux/libUE4Server-CoreUObject-Linux-Shipping.so (0x00007f1187099000)
libUE4Server-Engine-Linux-Shipping.so => /home/dc/utroot/LinuxServer/UnrealTournament/Binaries/Linux/./../../../Engine/Binaries/Linux/libUE4Server-Engine-Linux-Shipping.so (0x00007f11836e5000)
libUE4Server-UnrealTournament-Linux-Shipping.so => /home/dc/utroot/LinuxServer/UnrealTournament/Binaries/Linux/./libUE4Server-Unreal
@dcramps
dcramps / ffmpeg_mergeaudiotracks.sh
Created March 27, 2019 07:48
merge two audio tracks with ffmpeg
ffmpeg -i 'input.mp4' -filter_complex '[0:a:0][0:a:1]amerge=inputs=2[a]' -map '0:v:0' -map '[a]' -c:v copy -ac 2 'output.mp4'
@dcramps
dcramps / TintMyStatusBar.swift
Last active August 17, 2017 16:01
Use this class if you're a horrible person that wants to change the colour of an iOS status bar. If the status bar changes in any way, you have to do it again. Have fun.
final class TintMyStatusBar {
static func to(_ colour: UIColor) {
let sbw = UIApplication.shared.value(forKey: "statusBarWindow") as! UIWindow
for statusbar in sbw.subviews {
for bgfg in statusbar.subviews {
for itemView in bgfg.subviews {
let image = itemView.layer.contents as! CGImage
itemView.layer.contents = self.tint(image: image, toColour: colour)
}