Skip to content

Instantly share code, notes, and snippets.

View psobko's full-sized avatar

Piotrek Sobkowski psobko

View GitHub Profile
; ================ B E G I N N I N G O F P R O C E D U R E ================
sub_8600:
00008600 trap
00008602 tbb [pc, r0] ; CODE XREF=sub_847c+386
; endp
00008606 db 0x04, 0x14, 0x0e, 0x17, 0x11, 0x1a, 0x1d, 0x20
0000860e ldrb.w r0, [sp, #0x70]
@psobko
psobko / xcode_version.rb
Last active May 15, 2018 23:51
Check if the locally installed version of Xcode is up to date by parsing Apple's releases XML.
#!/usr/bin/env ruby
require 'open-uri'
apple_releases = open('https://developer.apple.com/news/releases/rss/releases.rss').read
latest_xcode = /(?<=<title>Xcode )[0-9.]* \([A-Z0-9]*(?=\)<\/title>)/im.match(apple_releases).to_s.tr('(','').split(' ')
local_xcode = /(?<=Xcode )[0-9.].*/im.match(`xcodebuild -version`).to_s.split("\nBuild version ")
puts "Local Xcode version: #{local_xcode[0]} - #{local_xcode[1]}"
if Gem::Version.new(latest_xcode[0]) > Gem::Version.new(local_xcode[0])
import Foundation
typealias PSHTTPClientResponseHandler = (Any?, URLResponse?, Error?) -> ()
class PSHTTPClient: NSObject {
private let shouldLog = false
private let shouldLogVerbose = true
private let session = URLSession.shared
@psobko
psobko / Default.handlebars
Last active March 4, 2018 01:47
Mermaid support for MacDown, override existing /Applications/MacDown.app/Contents/Resources/Templates/Default.handlebars
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
{{{ titleTag }}}
@psobko
psobko / test.swift
Created January 17, 2018 00:25
[placeholder test]
<#test#>
@psobko
psobko / IGDB_Platforms.json
Created January 7, 2018 03:26
IGDB platforms as of Jan 2018
[
{
"id": 3,
"name": "Linux"
},
{
"id": 4,
"name": "Nintendo 64"
},
{
@psobko
psobko / HTTPClient.swift
Created December 14, 2017 19:34
Basic Swift HTTP client
import Foundation
class HTTPClient: NSObject {
let logging = true
let session = URLSession.shared
func makeRequest(request: URLRequest, completionHandler: @escaping ([String:AnyObject]?, URLResponse?, Error?) -> Void) {
logRequest(request: request)
@psobko
psobko / URLSession_delegate_log.swift
Created February 25, 2017 20:00
Log all of the delegate callbacks for URLSession in Swift 3.0
// use URLSessionDelegate
var session : URLSession!
func someFunction() {
self.session = URLSession(configuration: URLSessionConfiguration.default, delegate: self, delegateQueue: nil)
}
func dLog(message: String, filename: String = #file, function: String = #function, line: Int = #line) {
iPad1: 127MB/256MB/49% (crash amount/total amount/percentage of total)
iPad2: 275MB/512MB/53%
iPad3: 645MB/1024MB/62%
iPad4: 585MB/1024MB/57% (iOS 8.1)
iPad Mini 1st Generation: 297MB/512MB/58%
iPad Mini retina: 696MB/1024MB/68% (iOS 7.1)
iPad Air: 697MB/1024MB/68%
iPad Air 2: 1195MB/2048MB/58% (iOS 8.x)
iPod touch 4th gen: 130MB/256MB/51% (iOS 6.1.1)
iPod touch 5th gen: 286MB/512MB/56% (iOS 7.0)
@psobko
psobko / Logger.h
Created September 16, 2015 20:36
DLogVars() - Log up to 28 expressions in DLog format
//
// Logger.h
// Logger
//
// Created by psobko on 9/16/15.
// Copyright (c) 2015 psobko. All rights reserved.
//
#ifndef Logger_Logger_h
#define Logger_Logger_h