Skip to content

Instantly share code, notes, and snippets.

View bencollier's full-sized avatar

Ben Collier bencollier

View GitHub Profile
+ (void)clearCaches {
// clear any URL caches
[[NSURLCache sharedURLCache] removeAllCachedResponses];
// clear any cookie caches
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://%@/", kAPIHost]];
for (NSHTTPCookie *cookie in [cookieStorage cookiesForURL:url]) {
[cookieStorage deleteCookie:cookie];
}
@paulirish
paulirish / utmstrip.user.js
Last active July 27, 2024 08:10
userscript: Drop the UTM params from a URL when the page loads
// ==UserScript==
// @name UTM param stripper
// @author Paul Irish
// @namespace http://github.com/paulirish
// @version 1.2
// @description Drop the UTM params from a URL when the page loads.
// @extra Cuz you know they're all ugly n shit.
// @include http*://*
// ==/UserScript==
@cowboy
cowboy / plus-brackets-only.js
Created May 21, 2011 21:55
What results can you get just using these characters: +[]
// What results can you get just using these characters: +[]
// I know this has been done before, but I don't have the link,
// and I don't want it (not yet, at least)
// basic numbers
0: +[]
1: ++[+[]][+[]]
2: ++[++[+[]][+[]]][+[]]
3: ++[++[++[+[]][+[]]][+[]]][+[]]
4: ++[++[++[++[+[]][+[]]][+[]]][+[]]][+[]]
@paulirish
paulirish / data-markdown.user.js
Last active February 6, 2024 10:41
*[data-markdown] - use markdown, sometimes, in your HTML
// ==UserScript==
// @name Use Markdown, sometimes, in your HTML.
// @author Paul Irish <http://paulirish.com/>
// @link http://git.io/data-markdown
// @match *
// ==/UserScript==
// If you're not using this as a userscript just delete from this line up. It's cool, homey.