Skip to content

Instantly share code, notes, and snippets.

View luismisanchez's full-sized avatar

Luismi Sánchez luismisanchez

View GitHub Profile
<?php
header('Content-type: text/plain; charset=utf-8');
error_reporting(E_ALL);
ini_set('display_errors', 1);
$script = basename(__FILE__);
$link = $_SERVER['HTTP_HOST'];
// Si venimos desde el botón INSTALAR WORDPRESS
// borramos este archivo y redirigimos al script de instalación de WordPress
@luismisanchez
luismisanchez / index.html
Created July 10, 2019 20:02
Responsive Tables (By columns)
<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>
@luismisanchez
luismisanchez / my.cnf
Created June 25, 2020 16:22 — forked from fevangelou/my.cnf
Optimized my.cnf configuration for MySQL/MariaSQL (on Ubuntu, CentOS etc. servers)
# Optimized my.cnf configuration for MySQL/MariaSQL
#
# by Fotis Evangelou, developer of Engintron (engintron.com)
#
# ~ 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
luismisanchez / typing.ts
Last active January 15, 2021 19:32
Typescript Typing
// 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
luismisanchez / Classes.ts
Created January 15, 2021 19:33
Typescript Classes
// 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
luismisanchez / Interfaces.ts
Created January 19, 2021 14:45
Typescript Interfaces
// 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
luismisanchez / Generics.ts
Created January 19, 2021 14:50
Typescript Generics
// 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
luismisanchez / Modules.ts
Created January 19, 2021 14:58
Typescript Modules
// 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
luismisanchez / secure_link.php
Created March 23, 2021 18:05 — forked from bftanase/secure_link.php
generate URL for nginx secure_link
@luismisanchez
luismisanchez / ffmpeg.md
Created April 25, 2021 14:26 — forked from steven2358/ffmpeg.md
FFmpeg cheat sheet