A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.
One-line version to paste in your DevTools
Use $$ if your browser aliases it:
~ 108 byte version
| /* 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)); }; |
| # Assume we are in your home directory | |
| cd ~/ | |
| # Clone the repo from GitLab using the `--mirror` option | |
| $ git clone --mirror [email protected]:mario/my-repo.git | |
| # Change into newly created repo directory | |
| $ cd ~/my-repo.git | |
| # Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks. |
| <?php | |
| class Blockout { | |
| public static function enblockout($s, $key) { | |
| // user provided blockout encoder | |
| return; | |
| } | |
| public static function deblockout($blockout, $key) { |
| <?php | |
| // minimal routing | |
| function web_app($routes, $req_verb, $req_path) { | |
| $req_verb = strtoupper($req_verb); | |
| $req_path = trim(parse_url($req_path, PHP_URL_PATH), '/'); | |
| $found = false; | |
| if (isset($routes[$req_verb])) { |
Attention: the list was moved to
https://github.com/dypsilon/frontend-dev-bookmarks
This page is not maintained anymore, please update your bookmarks.
| <?php | |
| /** | |
| * Pagination for a parent page and their child pages. | |
| * Use as gp130428_link_pages() in your template file. | |
| * Optionally limit to a particular parent page by passing its ID (i.e. 123) to the function: gp130428_link_pages( 123 ) | |
| * | |
| */ | |
| function gp130428_paginate_parent_children( $parent = null ) { | |
| global $post; | |
| // Linear Congruential Generator | |
| // Variant of a Lehman Generator | |
| var lcg = (function() { | |
| // Set to values from http://en.wikipedia.org/wiki/Numerical_Recipes | |
| // m is basically chosen to be large (as it is the max period) | |
| // and for its relationships to a and c | |
| var m = 4294967296, | |
| // a - 1 should be divisible by m's prime factors | |
| a = 1664525, | |
| // c and m should be co-prime |
| (function() { | |
| var script, | |
| scripts = document.getElementsByTagName('script')[0]; | |
| function load(url) { | |
| script = document.createElement('script'); | |
| script.async = true; | |
| script.src = url; | |
| scripts.parentNode.insertBefore(script, scripts); |