Skip to content

Instantly share code, notes, and snippets.

@moux2003
moux2003 / AutoMockable.stencil
Created June 13, 2024 13:18
Sourcery AutoMockable template
// swiftlint:disable line_length
// swiftlint:disable variable_name
import Foundation
#if os(iOS) || os(tvOS) || os(watchOS)
import UIKit
#elseif os(OSX)
import AppKit
#endif
@moux2003
moux2003 / sh
Created April 28, 2021 07:39
Script clean des branches locales disparues en remote
git fetch -p && for branch in $(git branch -vv | grep ': disparue]' | awk '{print $1}'); do git branch -D $branch; done
@moux2003
moux2003 / menu_mobile.widget.dart
Created June 24, 2020 16:00
animation slide via AnimatedBuilder
class _Mobile extends StatelessWidget {
final Widget child;
_Mobile({this.child});
@override
Widget build(BuildContext context) {
double width = MediaQuery.of(context).size.width / 3;
int elapsed = 1;
return Center(
@moux2003
moux2003 / hyperion.config.json
Created January 19, 2017 10:54
Hyperion config lightberry v1 46 LEDS
// Automatically generated configuration file for Hyperion ambilight daemon
// Notice: All values are explained with comments at our wiki: wiki.hyperion-project.org (config area)
// Generated by: HyperCon (The Hyperion deamon configuration file builder)
// Created with HyperCon V1.03.1 (11.06.2016)
{
// DEVICE CONFIGURATION
"device" :
{
"name" : "MyHyperionConfig",
@moux2003
moux2003 / createuser-db.sh
Last active September 19, 2016 09:27
createdb <database> <user> <password>
#!/bin/bash
EXPECTED_ARGS=3
E_BADARGS=65
MYSQL=`which mysql`
Q1="CREATE DATABASE IF NOT EXISTS $1;"
Q2="GRANT USAGE ON *.* TO $2@localhost IDENTIFIED BY '$3';"
Q3="GRANT ALL PRIVILEGES ON $1.* TO $2@localhost;"
Q4="FLUSH PRIVILEGES;"
@moux2003
moux2003 / Ssl-Http2-LetsEncrypt.md
Last active October 2, 2016 13:06
LetsEncrypt procedure

Install, configure and automatically renew Let's Encrypt SSL certificate

I've recentelly passed https://vincent.composieux.fr over HTTPS using a Let's Encrypt free SSL certificate so this blog articles will explain you how I've done it, how I also renew the certificate automatically every 60 days and how I've configured my Varnish and Nginx stack.

Let's introduce Let's Encrypt

This initiative is sponsored by the biggest Internet companies and browsers: Google (Chrome), Mozilla (Firefox), Akamai, Facebook, ... so this is widely supported.

@moux2003
moux2003 / keymap.cson
Created December 9, 2015 13:12
Nylas N1
'body':
'cmd-delete': 'application:delete-item'
'delete': 'application:archive-item'
@moux2003
moux2003 / config.txt
Created March 26, 2015 01:30
Enable SPI on OSMC fo raspberry
# file in /boot/config.txt, need reboot
dtparam=spi=on
@moux2003
moux2003 / phpmyadmin.conf
Created January 28, 2015 22:22
Nginx conf for phpmyadmin
server {
listen 8080;
server_name localhost;
root /home/zareth/phpmyadmin;
location / {
index index.php;
}
## Images and static content is treated different
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
# Change these settings to your own preference