Skip to content

Instantly share code, notes, and snippets.

luismisanchez / phpPrettyDebugger.php
Last active May 4, 2021
Simple PHP var pretty debugger
View phpPrettyDebugger.php
* Simple var pretty debugger
* @param $var
* @param false $exit
function pre_dump($var, bool $exit = false) {
//TODO: Only works if there is a pre_dump() call per line
luismisanchez /
Created Apr 25, 2021 — forked from steven2358/
FFmpeg cheat sheet
luismisanchez / secure_link.php
Created Mar 23, 2021 — forked from bftanase/secure_link.php
generate URL for nginx secure_link
View secure_link.php
luismisanchez / Modules.ts
Created Jan 19, 2021
Typescript Modules
View Modules.ts
// TypeScript is modular, we can divide our code up over several files
// In Angular 2 we then use "import {} from ''" to access the code in these files
// We export a class, interface, variable, ... by adding 'export' keyword in front of it
export class ExportedClass {
// This class is exported
luismisanchez / Generics.ts
Created Jan 19, 2021
Typescript Generics
View Generics.ts
// Generics are types which can hold/ use several types
// We're only touching the very basics here - you can go MUCH more into detail
// Consider the Array object
let numberArray: Array<number>; // This array will only accept numbers
// Try to initialize it with strings
// numberArray = ['test']; // => Error
luismisanchez / Interfaces.ts
Created Jan 19, 2021
Typescript Interfaces
View Interfaces.ts
// Interfaces allow us to create contracts other classes/ objects have to implement
// We can use them to define custom types without creating classes
// Interfaces ARE NOT compiled to JavaScript! It's just for checking/ validation done by our TypeScript compiler
// Example interface
interface User {
username: string;
password: string;
confirmPassword?: string; // Optional property => Does not have to be implemented
luismisanchez / Classes.ts
Created Jan 15, 2021
Typescript Classes
View Classes.ts
// Classes allow us to create 'blueprints' for objects
// In Angular 2 we use classes a lot. For example to create Components, Services, Directives, Pipes, ...
// How to create a class
class Car {
engineName: string;
gears: number;
private speed: number;
luismisanchez / typing.ts
Last active Jan 15, 2021
Typescript Typing
View typing.ts
// TypeScripts - well - strong typing allows us to define types for our variables and class members
// The compiler is going to yell at us if we assign a value of a wrong type to such a variable or member
// Declaring a variable with a type
// Using the 'let' keyword to create a variable ('const' would define an immutable constant)
let myString: string;
myString = 'This is a string';
luismisanchez / my.cnf
Created Jun 25, 2020 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
View my.cnf
# Optimized my.cnf configuration for MySQL/MariaSQL
# by Fotis Evangelou, developer of Engintron (
# ~ Updated January 2020 ~
# The settings provided below are a starting point for a 2GB - 4GB RAM server with 2-4 CPU cores.
# If you have different resources available you should adjust accordingly to save CPU, RAM & disk I/O usage.
luismisanchez / index.html
Created Jul 10, 2019
Responsive Tables (By columns)
View index.html
<h2>Column oriented table</h2>
<div class="Rtable Rtable--3cols">
<div style="order:1;" class="Rtable-cell"><h3>Eddard Stark</h3></div>
<div style="order:2;" class="Rtable-cell">Has a sword named Ice</div>
<div style="order:3;" class="Rtable-cell">No direwolf</div>
<div style="order:4;" class="Rtable-cell"><strong>Lord of Winterfell</strong></div>
<div style="order:1;" class="Rtable-cell"><h3>Jon Snow</h3></div>