Skip to content

Instantly share code, notes, and snippets.

@cferdinandi
cferdinandi / umd-script-boilerplate.js
Last active December 10, 2023 10:23
A simple boilerplate for UMD JS modules.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
@peet86
peet86 / l.php
Created November 21, 2012 12:59 — forked from keriati/l.php
For the silent game
<?php ini_set('display_errors', 1);error_reporting(E_ALL);
$h=$_GET['d'];$d=isset($h)?urldecode($h):dirname(__FILE__);
if(is_file($d)&&(header('Content-disposition: attachment; filename='.end(explode("/",$d)))||readfile($d)))exit();
foreach(scandir($d)as$f)echo'<li><a href="?d='.urlencode(realpath($d)."/$f")."\">$f</a></li>";