Skip to content

Instantly share code, notes, and snippets.

ellisgl / index.php
Last active Aug 29, 2015 — forked from jeremeamia/index.php
TweetMVC Returns - A PHP 5.4 MVC framework that fits in 3 tweets (A couple bytes smaller)
View index.php
<?php # TweetMVC Example App Bootstrap
# Import TweetMVC using error suppression to hide notices and warnings from the cold golfing
@include 'tmvc.php';
use TMVC\Cor\A;
# Basic namespaced autoloader, nothing too fancy
spl_autoload_register(function($class) {return @include __DIR__.'/src/'.strtr($class, '\\', '/').'.php';});
# Instantiate, configure, and execute the app
View gist:3b92a7fbca4962297bec4c906420a916
* Marlin 3D Printer Firmware
* Copyright (C) 2016 MarlinFirmware []
* Based on Sprinter and grbl.
* Copyright (C) 2011 Camiel Gubbels / Erik van der Zalm
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
View GLT-KB-E-1-R.kbd.json
"backcolor": "#666666",
"name": "GLT-KB-E-1-R",
"author": "Geeklab Technologies",
"switchMount": "cherry",
"switchBrand": "cherry",
"pcb": true,
"plate": false
ellisgl / PaginationTest.php
Last active Aug 28, 2021
Pagination of a MySQL query sorted by non-unique values benchmark.
View PaginationTest.php
// Pagination of a MySQL query ordered by non-unique values benchmark:
// The normal way with limit/offset.
// Grabbing all the id's and then doing the queries w/ groups of ids.
// This uses the MySQL employee example DB:
function get_time() {
list($usec, $sec) = explode(' ', microtime());
return ((float)$usec + (float)$sec);