A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
A timeline of the last four years of detecting good old window.localStorage.
October 2009: 5059daa
| <?php | |
| add_filter('content_save_pre', 'cleanup_annoying_writers'); | |
| function cleanup_annoying_writers($content) | |
| { | |
| remove_filter('content_save_pre', array($this, 'cleanup_annoying_writers')); | |
| $content =trim(stripslashes($content)); | |
| //No JS |
| function string_to_slug (str) { | |
| str = str.replace(/^\s+|\s+$/g, ''); // trim | |
| str = str.toLowerCase(); | |
| // remove accents, swap ñ for n, etc | |
| var from = "àáäâèéëêìíïîòóöôùúüûñç·/_,:;"; | |
| var to = "aaaaeeeeiiiioooouuuunc------"; | |
| for (var i=0, l=from.length ; i<l ; i++) { | |
| str = str.replace(new RegExp(from.charAt(i), 'g'), to.charAt(i)); | |
| } |
| <?php | |
| /** | |
| * Must-Use Functions | |
| * | |
| * A class filled with functions that will never go away upon theme deactivation. | |
| * | |
| * @package WordPress | |
| * @subpackage GRD | |
| */ | |
| class GRD_Functions { |
| #!/usr/bin/php -q | |
| <?php | |
| /* | |
| Ampp3d - Ampp3d Google Analytics | |
| Version: 0.1 | |
| Author: William Turrell | |
| Author URI: wturrell.co.uk | |
| Description: Use Google Analytics API to retrieve most popular pages and construct an HTML fragment we can use | |
| Adapted from http://www.techpunch.co.uk/development/oauth2-google-analytics-api-service-account-php and | |
| https://github.com/lobsterdore/analytics-api-oauth2-example/blob/master/mostPopularContentExample.php |
| varying vec2 vUv; | |
| uniform sampler2D tDiffuse; | |
| uniform sampler2D tColorLUT; | |
| uniform vec2 resolution; | |
| #pragma glslify: blendOverlay = require(./glsl-blend-overlay) | |
| #pragma glslify: displace = require(./glsl-displace) | |
| #pragma glslify: srcOver = require(./glsl-src-over) | |
| #pragma glslify: colorCorrect = require(glsl-lut/flipY) |
| /* bling.js */ | |
| window.$ = document.querySelector.bind(document); | |
| window.$$ = document.querySelectorAll.bind(document); | |
| Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); }; | |
| NodeList.prototype.__proto__ = Array.prototype; | |
| NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); }; |
| #include "FastLED.h" | |
| #if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000) | |
| #warning "Requires FastLED 3.1 or later; check github for latest code." | |
| #endif | |
| #define NUM_LEDS 100 | |
| #define LED_TYPE WS2811 | |
| #define COLOR_ORDER GRB |
| # Backup | |
| docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
| # Restore | |
| cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
| /////////////////////////// | |
| // ES6 original | |
| //////////////////////////// | |
| class A extends B { | |
| constructor(x) { | |
| this.x = x; | |
| } | |
| b() {return this.x}; | |
| } |