Skip to content

Instantly share code, notes, and snippets.

View sneakyness's full-sized avatar
💭
Rolling up to the function like a stretched out Steve Ballmer

Nick Pannuto sneakyness

💭
Rolling up to the function like a stretched out Steve Ballmer
View GitHub Profile
@Whelton
Whelton / gradients_maths_and_insanity.md
Created September 21, 2014 21:12
Gradients, Maths and Insanity

Here a quick thought of insanity before I leave the office at ~1.05am. I dwell and fret over design, particularly when its me making the decision, to the point of insanity (a recurring theme here).

If I have a base color, I use Adobe's Kuler to get matching colors (with some rule depending) or I checkout ColourLovers to use a platte crafted by someone with a keener eye than I. Similarly I use a typography calculator to define font sizes relative to each other and so on, so on. I have a whole bunch of these rules and methods I use so I can sleep easier knowing there is method behind my design choices.

Heres one I came up against just there, I wanted to put in a nice gradient as background in something I'm building at the moment, like anyone else who is a regular connoisseur of GitHub's trending repos, I stumbled across uiGradients ([Repo](https://git

@iMokhles
iMokhles / How to use the old prefs method within sandbox apps
Last active August 29, 2015 14:14
How to use the old prefs method within sandbox apps
static BOOL tweakEnabled = NO;
static void PreferencesChangedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
system("killall WhatsApp"); // kill app to apply changes ;)
NSDictionary *preferences = [[NSDictionary alloc] initWithContentsOfFile:@"TWEAK_PREFS_PATH"];
tweakEnabled = [preferences[@"tweakEnabled"] boolValue];
}
%ctor {
[[NSNotificationCenter defaultCenter] addObserverForName:UIApplicationDidFinishLaunchingNotification object:nil queue:[NSOperationQueue mainQueue] usingBlock:^(NSNotification *block) {
@billylindeman
billylindeman / TextureAtlas.java
Created June 24, 2011 18:24
This is a TextureAtlas class for AndEngine that will load in a Zwoptex Generic plist file (requires android-plist-parser)
//TextureAtlas for andengine
// Billy Lindeman (billy@zoa.io)
// 2011 Protozoa, LLC
//loads texture atlas from Zwoptex Generic plist file
//you pass it the name of the asset (without extension)
//it will load .plist as the coordinates and .png as the texture
//requires https://github.com/tenaciousRas/android-plist-parser
package org.anddev.andengine.opengl.texture.atlas;
@billylindeman
billylindeman / pltojs.py
Created June 24, 2011 21:08
plist to json converter
#!/usr/bin/env python
import plistlib
import json
import sys
def main():
if (len(sys.argv) < 2):
print str(sys.argv[0] + " <plist file>")
sys.exit(1)
@bytespider
bytespider / boilerplate.js
Created September 1, 2011 16:41
jsOAuth xAuth boilerplate
var oauth = OAuth({
consumerKey: 'MY-CONSUMER-KEY',
consumerSecret: 'MY-CONSUMER-SECRET'
});
oauth.post('https://api.twitter.com/oauth/access_token', {
'x_auth_username': 'DarthVader',
'x_auth_password': 'Luk3i5myS0n',
'x_auth_mode': 'client_auth'
}, successCallback, failureCallback);
@danzeeeman
danzeeeman / vine-notes.md
Last active December 12, 2015 03:08
My notes on Vine

##My Notes on Vine

Vine is an iOS only application that lets you shoot, edit, and upload a short 6 second clip. You can search twitter to find vines using the twitter api:search 'http://search.twitter.com/search.json?q=vine&since_id=MAX_ID' you'll get something like this (but with 15 results):

{
	   "completed_in" : 0.0110,
	   "max_id" : 2.982193446625239e+17,
	   "max_id_str" : "298219344662523904",
	   "next_page" : "?page=2&max_id=298219344662523904&q=vine",

"page" : 1,

@nicklockwood
nicklockwood / gist:7559729
Last active April 27, 2016 16:18
A proposal for an alternative NSNotificationCenter API that doesn't suck

Method

- (void)addObserver:(id)observer
            forName:(NSString *)name
             object:(id)object
              queue:(NSOperationQueue *)queue
         usingBlock:(void (^)(NSNotification *note, __weak id observer))block;

Usage

@elliottsj
elliottsj / uikit-apple-watch.md
Last active May 30, 2016 00:12
My attempt at getting UIKit to work on watchOS 2
/*
keepaway: a silly plugin that makes elements run from the mouse
by sneakyness.
options:
jump: the distance to jump away from the mouse, in pixels; default 500
speed: the speed to move (passed intact to the animate plugin); default ÔfastÕ
home: time to return to the starting position if nothing happens, in ms; default 1000
@iMokhles
iMokhles / CFPreferencesAppSynchronize with ARC and non ARC.xm
Last active August 16, 2020 13:28
How to use CFPreferencesAppSynchronize with ARC and non ARC (iOS8 Tweaks) + CFNotificationCallback (option) Works fine with Sandbox Apps
static BOOL tweakEnBOOL;
#define SETTINGSFILENEW "com.imokhles.Prefs"
#define PREFERENCES_CHANGED_NOTIFICATION "com.imokhles.Prefs.preferences-changed"
// non ARC
static void iMoLoadPreferences() {
CFPreferencesAppSynchronize(CFSTR(SETTINGSFILENEW));
tweakEnBOOL = !CFPreferencesCopyAppValue(CFSTR("Enabled"), CFSTR(SETTINGSFILENEW)) ? YES : [(id)CFBridgingRelease(CFPreferencesCopyAppValue(CFSTR("Enabled"), CFSTR(SETTINGSFILENEW))) boolValue];
}