Skip to content

Instantly share code, notes, and snippets.

🐘
Coding

Alain Tiemblo ninsuo

🐘
Coding
Block or report user

Report or block ninsuo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ninsuo
ninsuo / code.php
Created Jun 24, 2019
Cornichonize
View code.php
<?php
class Cornicode
{
static public function cornichonize(string $text) {
// Reverse
$cypher = strrev($text);
// Rotate
@ninsuo
ninsuo / templatize.php
Created May 10, 2019
Takes each line in stdin, and wrap it with a template
View templatize.php
<?php
if (!isset($argv[1])) {
die(sprintf('You forgot to give a template: %s "<prefix> %%s <suffix>"%s', $argv[0], "\n"));
}
$template = $argv[1];
$raw = file_get_contents('php://stdin');
$lines = explode(PHP_EOL, $raw);
@ninsuo
ninsuo / degrade.php
Created Mar 6, 2019
degrade.php - the most ugly code i ever made in life
View degrade.php
<?php
// ------------------------------------------
// DEGRADE ( GD )
// ------------------------------------------
// ---------------------------------------------
// Allowed GET arguments:
// a -> applies transparency to background color
// c -> colors (use '-' for color separator)
View Monospace.php
<?php
/**
* Cette classe permet d'écrire un document de type plain/text
* formatté en monospace.
*
* Cette classe supporte :
* - les lignes
* - l'alignement
* - les sauts de ligne
@ninsuo
ninsuo / certbot-auto-renew.sh
Last active Jun 15, 2017
auto renewing cerificates generated from lets-encrypt
View certbot-auto-renew.sh
#!/dgr/bin/busybox sh
# copied from https://github.com/n0rad/rkt-images/blob/master/aci/arch/aci-arch-nginx-certbot/templates/start.tmpl.sh
set -e
. /dgr/bin/functions.sh
isLevelEnabled "debug" && set -x
## Create certif
# certbot certonly --email email@example.com --webroot -w /var/lib/letsencrypt/ -d domain.tld,sub.domain.tld
View tmux_cheatsheet.markdown

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@ninsuo
ninsuo / xliff-to-yaml.php
Last active Jan 18, 2019
Takes a Symfony xlf file and converts it to YAML
View xliff-to-yaml.php
<?php
$content = file_get_contents('messages.en.xlf');
/*
Converts crazy xliffs files into readable yaml:
<?xml version="1.0" encoding="utf-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
@ninsuo
ninsuo / tidypics.php
Last active Feb 23, 2016
Tidy up pictures from a camera (generated path format: Y-m-d/H:i:s.ext)
View tidypics.php
<?php
# Run me inside a directory full of pictures
# Create an alias for easier use!
date_default_timezone_set('Europe/Paris');
$path = $_SERVER['PWD'];
$glob = glob("/{$path}/*");
You can’t perform that action at this time.