Skip to content

Instantly share code, notes, and snippets.

View CraigsOverItAll's full-sized avatar
⌨️
300% Utilisation

Craig Phillips CraigsOverItAll

⌨️
300% Utilisation
View GitHub Profile
@CraigsOverItAll
CraigsOverItAll / gitlint
Last active April 13, 2019 05:17
GitLint an Xcode build phase run script to help apply Swift linting rules to your code base Incrementally
#!/bin/sh
function gitlint {
count=0
for file_path in $(git ls-files -om --exclude-from=.gitignore -- ':!:Pods/**'| grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
count=$((count + 1))
done
for file_path in $(git diff --cached --name-only | grep ".swift$"); do
export SCRIPT_INPUT_FILE_$count=$file_path
@CraigsOverItAll
CraigsOverItAll / loc
Created October 11, 2018 05:15
loc - Lines of Code (a simple bash script for a quick and dirty count of lines of code in an Xcode project, works with Swift, Objective-C, C and C++ files)
#!/bin/sh
# Quick and simple "Lines Of Code" script
# Colors for output
p="\033[38;5;208m"
g="\033[38;5;7m"
a="\033[38;5;10m"
# Colour end
e="\033[0;00m"

Thoughts on jailbreak detection

The controversy of jailbreak detection has been brought up multiple times in my Twitter feed, so in order to not have to repeat myself, I'll write my thoughts down here.
One day I'll hopefully get round to set up a realistic blog and then I'll move this there, but for now I'll just dump it here on GitHub.

Motivation

Hi. I'm Siguza, and among other things I write exploits for a hobby and help make jailbreaks. One of the reasons I do that is because I believe we should have the ability to run whatever we want on our iDevices, just as we do with laptops and desktop computers. Now, a lot of app developers however seem to despise jailbreaks, and try to make their apps refuse service on jailbroken devices. I think that firstly sucks big time, and secondly always misses the point. From what I gathered, the two arguments for using jailbreak detection seem to be:

  • "J
@CraigsOverItAll
CraigsOverItAll / Makefile
Created August 13, 2018 04:03 — forked from ralfebert/slice.py
Export images from Sketch to xcasset (by @ryangomba)
slices:
python Assets/slice.py Assets/Example.sketch MyProject/Assets.xcassets
@CraigsOverItAll
CraigsOverItAll / XcodeVersion
Last active October 11, 2018 04:49
Bash script to generate version, iOS build numbers and macOS build number from a projects Git repository.
#!/bin/sh
# Generates a version and build numbers from repository tags starting with a 'v' e.g. v1.0.3
# and commit counts
# Colors for output
p="\033[38;5;208m"
g="\033[38;5;7m"
a="\033[38;5;10m"
# Colour end
e="\033[0;00m"
@CraigsOverItAll
CraigsOverItAll / my.cnf
Created May 28, 2016 02:30 — forked from fevangelou/my.cnf
Optimized MySQL configuration for cPanel servers
# Optimized MySQL configuration for cPanel servers by Fotis Evangelou - Updated Feb 2016
#
# The settings provided below are a starting point for a 4GB-8GB RAM server with 4 CPU cores.
# If you have less or more resources available you MUST adjust accordingly to save CPU, RAM and disk I/O usage.
# To fine tune these settings for your system, use MySQL DB diagnostics tools like:
# https://launchpad.net/mysql-tuning-primer
# or
# http://blog.mysqltuner.com/download/
# Note that if there is NO comment beside a setting, then you don't need to adjust it.
@CraigsOverItAll
CraigsOverItAll / keybase.md
Last active September 21, 2016 03:15
keybase.md

Keybase proof

I hereby claim:

  • I am craigtheatheist on github.
  • I am craigp (https://keybase.io/craigp) on keybase.
  • I have a public key ASBn0nALvphLR9J9HurE8gB5TNN7Zdhn9zJC5jIosdq7Owo

To claim this, I am signing this object:

Logo

Now Hiring: ParkatmyHouse.com

At ParkatmyHouse.com we are looking to expand our small team to include a number of new development positions ahead of a major project. Go ahead and take a look at the role descriptions. If the must haves don't quite fit, let us know anyway, you never know!


Front-end Developer

Must have

@CraigsOverItAll
CraigsOverItAll / Remove YouTube "Flash Required"
Last active January 2, 2016 18:49
This is a little bookmarklet that removes the very annoying message "The Adobe Flash Player is required for video playback. Get the latest Flash Player". It turns out that mostly this is a lie and simply removing the elements from the DOM of the YouTube reveals the HTML5 Player and you can watch the video.
javascript:(function(){
derror = document.querySelector('.ytp-error');
derror.parentNode.removeChild(derror);
dloader = document.querySelector('.html5-video-loader');
dloader.parentNode.removeChild(dloader);
}());
// Use the single line version below for your bookmarklet.
javascript:(function(){derror=document.querySelector('.ytp-error');derror.parentNode.removeChild(derror);dloader=document.querySelector('.html5-video-loader');dloader.parentNode.removeChild(dloader);}());
<?php
/**
* CIDR.php
*
* Utility Functions for IPv4 ip addresses.
*
* @author Jonavon Wilcox <jowilcox@vt.edu>
* @version Sat Jun 6 21:26:48 EDT 2009
* @copyright Copyright (c) 2009 Jonavon Wilcox
*/