Skip to content

Instantly share code, notes, and snippets.

Adrian Jones adrianbj

Block or report user

Report or block adrianbj

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View macbook-pro-2011-defective-gpu-fix-v2.md
@Kudratullah
Kudratullah / unicode2html.php
Last active Feb 22, 2017
Convert UniCode Escape Character to UTF-8
View unicode2html.php
<?php
// Works Perfict
function uni2html($string){
//preg_replace(): Compilation failed: PCRE does not support \L, \l, \N{name}, \U, or \u at offset 1.
//so can't use $string = preg_replace('/\\u([0-9A-Za-z]+)/', '&#x$1;', $string); directly.
$string = explode('\\', $string);
$string = implode('%', $string);
$string = preg_replace('/%u([0-9A-Za-z]+)/', '&#x$1;', $string);
return html_entity_decode($string, ENT_COMPAT, 'UTF-8');
@jlong
jlong / uri.js
Created Apr 20, 2012
URI Parsing with Javascript
View uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@jakebellacera
jakebellacera / ICS.php
Last active Feb 16, 2020
A convenient script to generate iCalendar (.ics) files on the fly in PHP.
View ICS.php
<?php
/**
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.
*
@hagenburger
hagenburger / javascript_loader.js
Created Jul 30, 2010
Dynamically load JavaScript files with callback when finished
View javascript_loader.js
// Example:
JavaScript.load("/javascripts/something.js");
// With callback (that’s the good thing):
JavaScript.load("http://www.someawesomedomain.com/api.js", function() {
API.use(); // or whatever api.js provides ...
});
You can’t perform that action at this time.