Skip to content

Instantly share code, notes, and snippets.

View sdeluce's full-sized avatar

Stéphane Deluce sdeluce

View GitHub Profile
@spicycode
spicycode / tmux.conf
Created September 20, 2011 16:43
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
#set -g default-terminal screen-256color
set -g status-keys vi
set -g history-limit 10000
<!doctype html>
<!-- http://taylor.fausak.me/2015/01/27/ios-8-web-apps/ -->
<html>
<head>
<title>iOS 8 web app</title>
<!-- CONFIGURATION -->
// if no title then add widget content wrapper to before widget
add_filter( 'dynamic_sidebar_params', 'check_sidebar_params' );
function check_sidebar_params( $params ) {
global $wp_registered_widgets;
$settings_getter = $wp_registered_widgets[ $params[0]['widget_id'] ]['callback'][0];
$settings = $settings_getter->get_settings();
$settings = $settings[ $params[1]['number'] ];
if ( $params[0][ 'after_widget' ] == '</div></div>' && isset( $settings[ 'title' ] ) && empty( $settings[ 'title' ] ) )
@cryptix
cryptix / pgpTestTool.go
Created December 28, 2014 16:20
PGP file encryption in golang
package main
import (
"archive/zip"
"fmt"
"log"
"os"
"time"
"github.com/cryptix/go/logging"
@sdeluce
sdeluce / .zshrc
Created August 25, 2015 08:53
Add Apple Numpad to ZSH terminal
# Keypad
# 0 . Enter
bindkey -s "^[Op" "0"
bindkey -s "^[On" "."
bindkey -s "^[OM" "^M"
# 1 2 3
bindkey -s "^[Oq" "1"
bindkey -s "^[Or" "2"
bindkey -s "^[Os" "3"
# 4 5 6
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active December 18, 2025 04:52
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Last update: Nov 2025.

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl ecparam -genkey -name secp384r1 | openssl ec -aes256 -out rootCA.key
@sdeluce
sdeluce / bootable USB
Last active January 27, 2017 18:49
Création d'un clef usb bootable via OsX en Cli
# convertir l'iso en img
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/mint.iso
# Convertir l'img dmg en img
mv ~/path/to/target.img.dmg ~/path/to/target.img
# Liste des périphériques
diskutil list
# Replace N by value find in list
@jcavat
jcavat / Dockerfile
Last active April 15, 2025 17:40
docker-compose with php/mysql/phpmyadmin/apache
FROM php:7.1.2-apache
RUN docker-php-ext-install mysqli
sudo apt-get update
sudo apt-get install hostapd isc-dhcp-server
sudo apt-get install iptables-persistent
sudo nano /etc/dhcp/dhcpd.conf
# Find the lines that say
option domain-name "example.org";
option domain-name-servers ns1.example.org, ns2.example.org;
@joemaller
joemaller / luxon.md
Created January 23, 2018 14:29
Luxon Timestamps

Finding this took me longer than it should have, probably because I was impatiently looking for "timeststamp" instead of "milliseconds of the Unix epoch". For future searchers, Luxon uses the methods DateTime.fromMillis and DateTime.valueOf.

// Create a Luxon DateTime from a JS Unix timestamp
const ts = new Date().getTime();     // 1516717417146
const dt = DateTime.fromMillis(ts);  // { ts: 2018-01-23T09:23:37.146-05:00 ...
console.log(dt.valueOf());           // 1516717417146