Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Chris Jones cmsj

🏠
Working from home
Block or report user

Report or block cmsj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:fcf5d5fcd3947601658f5201e006207f
- (void)fill:(int)button withColor:(NSColor*)fillColor {
int imageSideLength = 72;
NSImage *image = [[NSImage alloc] initWithSize:NSMakeSize(imageSideLength, imageSideLength)];
[image lockFocus];
[fillColor drawSwatchInRect:NSMakeRect(0, 0, imageSideLength, imageSideLength)];
[image unlockFocus];
//NSData *imageTiff = image.TIFFRepresentation;
//NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:imageTiff];
//NSData *data = [imageRep representationUsingType:NSBitmapImageFileTypeBMP properties:@{}];
@cmsj
cmsj / iOS-File-System-Extraction.md
Created Jul 31, 2017
Guide to extract the root file system and decompress the kernel cache for iOS.
View iOS-File-System-Extraction.md

iOS File System Extraction

For iOS 10 and Up

Starting with iOS 10.0 Apple decrypted the file system and kernel cache. All you have to do is download an IPSW, change the extension to .zip, and unarchive it. The largest size disk image inside the unarchived zip will be the root file system. Simply mount it to see its contents.

Links to download all iOS IPSWs.

For iOS 9 and Below

Originally from /u/RowRocka on Reddit. Gently edited for clarity.

Links to download all iOS OTA ZIPs.

View karabiner.json
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": false,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"rules": [
View appswitch.lua
lastApp = nil
function launchFocusOrSwitchBack(appName)
-- This function will launch appName if it's not running, focus
-- it if it is running, or if it's already focused, switch back
-- to whatever the last focused App was
-- (The Pro version of this would use hs.windowfilter to track
-- window focus events, but for now we'll just assume that this
-- is the only way apps will be switched)
local currentApp = hs.application.frontmostApplication()
View protect.py
#!/usr/bin/env python
from datetime import datetime
import subprocess
import getopt
import sys
import os
import re
results={}
View .vimrc
" Be iMproved
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
" Bundles
Bundle 'gmarik/vundle'
Bundle 'ctrlpvim/ctrlp.vim'
View gpg-migration.txt.asc.asc
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
- -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hello world
My name is Chris Jones and I am changing my GPG key.
The original key fingerprint is: 6C99 9021 9B3A EC6D 4A28 7EE7 C574 7646 7313 2D75
View -
#!/bin/bash
# Put this script in the folder that your Games_WHDLoad directory lives in. Dump update pack directories in the same place and run the script
export SETOPTS="${SETOPTS:--eux}"
set "${SETOPTS}"
export BASEDIR
BASEDIR="$(dirname "$0")"
export GAMESDIR="${BASEDIR}/Games_WHDLoad"
View -
diff --git a/extensions/eventtap/event.m b/extensions/eventtap/event.m
index 8fe09e6..358eeb4 100644
--- a/extensions/eventtap/event.m
+++ b/extensions/eventtap/event.m
@@ -406,6 +406,7 @@ static int eventtap_event_newKeyEvent(lua_State* L) {
eventSource = CGEventSourceCreate(kCGEventSourceStatePrivate);
}
+ NSLog(@"Creating key event. Modifiers: %llu, keyCode: %d, isDown: %@", flags, keycode, isdown ? @"YES" : @"NO");
CGEventRef keyevent = CGEventCreateKeyboardEvent(eventSource, keycode, isdown);
View -
" Be iMproved
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle
call vundle#rc()
" Bundles
Bundle 'gmarik/vundle'
Bundle 'kien/ctrlp.vim'
You can’t perform that action at this time.