Quantcast
Channel: Recent Gists from devnix
Browsing all 13 articles
Browse latest View live

cracking.md

cracking.md MacOS Download from here: http://d.pr/f/QE3d MD5: 59bab8f71f8c096cd3f72cd73851515d Rename it to: Sublime Text Make it executable with: chmod u+x Sublime\ Text Replace it with: Sublime...

View Article



Gotham needs a hero...

batman.js var string = "abc"; var number = string++; number = number.toString(); var output = ''; var i = 0; while (i <= 16) { output = output + number; i++; } console.log(output + " Batman!");

View Article

Bootstrap 3 CSS media queries

media-queries.css /* Reference: http://goo.gl/6ise9j */ /* col-xs */ @media(max-width:767px) { } /* col-sm */ @media(min-width:768px) { } /* col-md */ @media(min-width:992px) { } /* col-lg */...

View Article

Wordpress 4.2.1 hotfix (put this file inside wp-includes)

README.md Wordpress 4.2.1 hotfix Overwrite your bad ol' wp-includes/formatting.php with this file to avoid that annoying PHP warning. If you prefer to fix it yourself instead downloading a 4.3k php...

View Article

Javascript strict mode

index.js (function() { 'use strict'; // Your code })();

View Article


Calculate difference in percentage between 2 hex colors. Port from Javascript...

colormeter.php <?php function color_meter($cwith, $ccolor) { if (empty($cwith) || empty($ccolor)) return false; $_cwith = ($cwith[0] === '#') ? substr($cwith, 1, 7) : $cwith; $_ccolor = ($ccolor[0]...

View Article

Render the Prestashop's blockcart module in Wordpress (or any external script)

prestashop-cart.php <?php // Prestashop's root folder, in my example Prestashop is installed in the root folder, and Wordpress is installed in /blog define('PRESTASHOP_ROOT', ABSPATH.'..'); //...

View Article

Snippet for easily using requestAnimationFrame with browser events

README.md Usage var OptimizedEvent = require('optimizedEvent'); var optimizedEvent = new OptimizedEvent(); optimizedEvent.add(function() { console.log('requestAnimationFrame\'d scroll :-D'); },...

View Article


CommonJS DOM-based Routing

app.js window.App = { common: require('./app/Common'), HomeController: require('./app/Controllers/HomeController'), }; var UTIL = { exec: function (controller, action) { var ns = App, // Change the...

View Article


freedom_public

file {"0.2701657162063611":"-----BEGIN PGP PUBLIC KEY BLOCK-----\r\nCharset:...

View Article

Example of pagination with Twig

_pagination.html.twig {# Parameters: * total (int): number of pages * current (int): current pages * url (string): route name & query (string): route parameter ex: list/page-5?q=myFilter (5 = page...

View Article

Handling optional input parameters in PHP with `vimeo/psalm` and `azjezz/psl`

handling-optional-input-fields-with-type-safe-abstractions.mdHandling optional input parameters in PHP with vimeo/psalm and azjezz/pslI had an interesting use-case with a customer for which I provide...

View Article

Hexagonal container inspired by PHPStan source code

ContainerInterface.php This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden...

View Article

Browsing all 13 articles
Browse latest View live




Latest Images