Skip to content

Instantly share code, notes, and snippets.

View KaiserWerk's full-sized avatar

R. Kaiser KaiserWerk

  • Germany
  • 05:20 (UTC +02:00)
View GitHub Profile
@KaiserWerk
KaiserWerk / .gitignore
Created April 21, 2019 10:05
.gitignore template
/.idea/
/.git/
/vendor/
/var/*
!/var/cache
/var/cache/*
!var/cache/.gitkeep
!/var/lock
/var/lock/*
@KaiserWerk
KaiserWerk / file_list_2_file_size_order.php
Last active March 11, 2019 20:53
List files recusively ordered by file size
<?php
/**
* Source: https://www.jodyhatton.com/how-big-is-my-website-how-to-get-a-list-of-all-files-and-folders-directories-using-php/
*/
$pathLen = 0;
function prePad($level)
{
$ss = "";
@KaiserWerk
KaiserWerk / Session.php
Created February 25, 2019 10:04
Store sessions in DB (using using catfan/medoo)
<?php
class Session
{
private $db = false;
public function __construct()
{
$this->db = new \Medoo\Medoo(); // http://medoo.in
@KaiserWerk
KaiserWerk / requirements_check.php
Created February 3, 2019 01:35
Simple requirements check
<?php
if (version_compare(PHP_VERSION, '7.0.0') < 0) {
die('PHP 7 is required; your version is ' . PHP_VERSION);
}
$extensions = get_loaded_extensions();
$requiredExtensions = [
'json',