Skip to content

Instantly share code, notes, and snippets.

@conradev
conradev / cydia_report.py
Created May 19, 2012 17:07
Cydia Store Daily Report
#!/usr/bin/python
import string, time, calendar, hashlib, urllib2, smtplib
from email.mime.text import MIMEText
# Cydia globals
product_ids = ['org.thebigboss.somepackage', 'org.thebigboss.someotherpackage']
splits = [ 0.70, 0.35 ]
vendor_id = ""
vendor_secret = ""
@conradev
conradev / cycriptBot.py
Created June 4, 2012 05:03
Cycript IRC Bot
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol
import sys, os, subprocess, tempfile
class CycriptBot(irc.IRCClient):
nickname = "cycriptbot"
def __init__(self):
self.process = "SpringBoard"
@conradev
conradev / gist:3362607
Created August 15, 2012 19:00
Recursively remove NSNull instances
// Use case being removing null values from the results of JSON encoding (thus only supports dictionaries and arrays)
__block id (^removeNull)(id) = ^(id rootObject) {
// Recurse through dictionaries
if ([rootObject isKindOfClass:[NSDictionary class]]) {
NSMutableDictionary *sanitizedDictionary = [NSMutableDictionary dictionaryWithDictionary:rootObject];
[rootObject enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) {
id sanitized = removeNull(obj);
if (!sanitized) {
[sanitizedDictionary removeObjectForKey:key];
} else {
@conradev
conradev / get_libraries.sh
Created March 19, 2013 19:29
This script downloads and extracts libraries from Cydia packages and places them into your Theos installation.
#!/bin/bash
# The only tool used here that is not included with OS X is `lzma`.
# It is only used when extracting packages with LZMA data compression.
echo "Downloading list of packages..."
REPOS=('http://apt.thebigboss.org/repofiles/cydia'); # Others, such as ModMyi can be added here
for i in "${!REPOS[@]}"; do
curl -s -L "${REPOS[i]}/dists/stable/main/binary-iphoneos-arm/Packages.bz2" | bzcat -- >> "Packages.${i}"
done
@import UIKit;
@import AVFoundation;
@class _UISiriWaveyView;
@protocol _UISiriWaveyViewDelegate <NSObject>
- (CGFloat)audioLevelForWaveyView:(_UISiriWaveyView *)waveyView;
@end
typedef NS_ENUM(NSInteger, _UISiriWaveyViewMode) {
@conradev
conradev / CKSpinnerView.h
Created September 19, 2013 21:05
CKSpinnerView - Emulating the app download spinner in the iOS 7 App Store
//
// CKSpinnerView.h
//
// Created by Conrad Kramer on 9/19/13.
// Copyright (c) 2013 Conrad Kramer. All rights reserved.
//
#import <CKShapeView/CKShapeView.h>
@interface CKSpinnerView : CKShapeView
@conradev
conradev / stars.py
Last active December 11, 2016 14:32
Command line utility to print out a user's Github stars
#!/usr/bin/env python
# coding: utf8
import sys, urllib2, json
def width():
def ioctl_GWINSZ(fd):
try:
import fcntl, termios, struct, os
cr = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
@conradev
conradev / CKBlurDetection.h
Created January 27, 2014 19:28
UIKit Blur Detection
//
// CKBlurDetection.h
//
// Created by Conrad Kramer on 1/23/14.
// Copyright (c) 2014 Kramer Software Productions, LLC. All rights reserved.
//
extern BOOL CKBlurEnabled();
@conradev
conradev / simulatorconsole
Last active December 16, 2015 00:45
simulatorconsole
#!/bin/bash
tail -f $(ls -t "$HOME/Library/Logs/CoreSimulator/"*/system.log | head -1)
@conradev
conradev / UIImage+CGImagePropertyOrientation.m
Created October 28, 2014 22:41
UIImage+CGImagePropertyOrientation
@implementation UIImage (CGImagePropertyOrientation)
- (CGImagePropertyOrientation)cgImagePropertyOrientation {
switch (self.imageOrientation) {
case UIImageOrientationUp:
return kCGImagePropertyOrientationUp;
case UIImageOrientationDown:
return kCGImagePropertyOrientationDown;
case UIImageOrientationLeft:
return kCGImagePropertyOrientationLeft;