Skip to content

Instantly share code, notes, and snippets.

Wesley Victhor Mendes Santiago wesleyvicthor

  • kollex
  • Berlin, Germany
Block or report user

Report or block wesleyvicthor

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
@Ocramius
Ocramius / Caddyfile
Last active Dec 5, 2019
Example docker + docker-compose + caddy + traefik setup that routes to multiple apps from one exposed HTTP port
View Caddyfile
:80 {
root /serve
}
View clock-example.php
<?php
/**
* This is the clock interface. It's really simple, you write it once, use it anywhere.
* Cool extra things you can do:
* - have it return custom value objects
* - separate method for currentDate() without time part
*/
interface Clock
{
@leonderijke
leonderijke / svgfixer.js
Last active Sep 26, 2019
Fixes references to inline SVG elements when the <base> tag is in use.
View svgfixer.js
/**
* SVG Fixer
*
* Fixes references to inline SVG elements when the <base> tag is in use.
* Firefox won't display SVG icons referenced with
* `<svg><use xlink:href="#id-of-icon-def"></use></svg>` when the <base> tag is on the page.
*
* More info:
* - http://stackoverflow.com/a/18265336/796152
* - http://www.w3.org/TR/SVG/linking.html
@netojoaobatista
netojoaobatista / 1lr-query.php
Last active Dec 15, 2015
Obtendo registros aleatórios de uma base sem utilizar ORDER BY RAND()
View 1lr-query.php
<?php
$pdo = new PDO('mysql:host=127.0.0.1;dbname=base', 'user', 'pswd');
$stm = $pdo->query('
SET @count = (SELECT COUNT(*) FROM tabela);
SET @query = CONCAT("SELECT * FROM `tabela` LIMIT 4 OFFSET ", 1 + FLOOR(RAND() * @count));
PREPARE stmt FROM @query;
EXECUTE stmt;
');
You can’t perform that action at this time.