Skip to content

Instantly share code, notes, and snippets.

View Raztor0's full-sized avatar

Razvan Bangu Raztor0

View GitHub Profile
@Raztor0
Raztor0 / example.m
Last active March 3, 2018 23:47
NSJSONSerialization EXC_BAD_ACCESS KERN_INVALID_ADDRESS
+ (void)load {
static NSMutableDictionary *myMutableDict;
static NSDictionary *myDict;
myMutableDict = [NSMutableDictionary dictionaryWithDictionary:@{}];
myDict = @{@"sub_dict" : myMutableDict};
/* Hop on a background thread */
dispatch_async(dispatch_get_global_queue(0, 0), ^{
/* Constantly mutate the mutable dictionary */
@Raztor0
Raztor0 / facebook_header.json
Last active December 31, 2018 09:10
fb headers
{
"Host": "poc.razb.me",
"Connection": "Keep-Alive",
"Accept-Encoding": "gzip",
"Accept": "*\\/*",
"User-Agent": "facebookexternalhit\\/1.1 (+http:\\/\\/www.facebook.com\\/externalhit_uatext.php)",
}
{
"Host": "poc.razb.me",
"Connection": "Keep-Alive",
"Accept-Encoding": "gzip",
"User-Agent": "Mozilla\\/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit\\/537.36 (KHTML, like Gecko) Chrome\\/71.0.3578.98 Safari\\/537.36",
}
@Raztor0
Raztor0 / fb_bot_redirect.php
Created December 31, 2018 09:19
Redirect for Facebook's social preview bot
<?php
$user_agent = $_SERVER["HTTP_USER_AGENT"];
if (strpos($user_agent, "facebookexternalhit") !== false) {
header("Location: https://runescape.com");
} else {
echo("poc.razb.me");
}