Skip to content

Instantly share code, notes, and snippets.

View m4dz's full-sized avatar

m4dz m4dz

View GitHub Profile
@m4dz
m4dz / README.md
Last active January 27, 2023 01:14
OS X Fresh (Re)Install

OS X ENV (re)Install

This is my personal guide to restore my configuration and setup my system for a fresh install. I use it and keep it updated frequently. Hope it will inspire you on your own way =].

Backup

Before a fresh reinstall, don't forget to backup many things. A regular ghost made with CarbonCopyCloner or Clonezilla is a good solution, but if you can't, you should save the following:

# The configfile is divided into three parts;
# 1) serversettings
# 2) rules
# 3) routes
#
# The recommended order is:
# Serversettings:
# logoutput
# internal
# external
@import cozy-ui/tabs
.app-tabs
@extend $tabs-default
import styles from '../styles/sidebar'
import { h } from 'preact'
import classNames from 'classnames'
import Nav from './nav'
const Sidebar = () => (
<aside class={ classNames(styles['fil-sidebar'], 'active') }>
<Nav />
#!/bin/bash
source backup.cfg
source zbackup-tar.sh
source zbackup-pgsql.sh
# --- INIT
FULL=false
RESET=false
RELATIVE=false
@m4dz
m4dz / README.md
Last active March 17, 2016 13:26
jQuery plugins boilerplates

This files contains my boilerplates for jQuery plugins.

@m4dz
m4dz / m4dz.zsh-theme
Last active February 1, 2016 10:51
m4dz ZSH theme
# Colors
autoload colors && colors
for COLOR in RED GREEN YELLOW BLUE MAGENTA CYAN BLACK WHITE; do
eval $COLOR='%{$fg_no_bold[${(L)COLOR}]%}' #wrap colours between %{ %} to avoid weird gaps in autocomplete
eval BOLD_$COLOR='%{$fg_bold[${(L)COLOR}]%}'
done
eval RESET='%{$reset_color%}'
omg_default_color_on=$WHITE
omg_default_color_off=$WHITE
@m4dz
m4dz / README.md
Created January 29, 2016 08:09
Surcharge DNS sur le LAN

Contexte

Je cherche à mettre en place un serveur DNS sur mon LAN, qui servirait a la fois de cache local et permettrait de s'affranchir d'une censure DNS éventuelle pratiquée par un FAI. Quitte à utiliser un serveur DNS local au LAN, autant lui faire servir des IP locales sur certains FQDN, je m'explique : j'utilise un domaine (foo.tld) dont certains sous-domaines pointent vers des machines présentent sur mon LAN (home.foo.tld par exemple). C'est très pratique pour accéder aux machines depuis l'extérieur (le routeur en tête du LAN fait du port-forwarding). Problème : quand je suis dans le LAN, je continue d'appeler l'IP publique du routeur pour atteindre les machines à l'intérieur du LAN au lieu de taper sur les IP LAN. Un serveur DNS local me permet donc de récupérer certains FQDN (home.foo.tld) pour le renvoyer vers une IP locale. Problème : j'ai aussi besoin de conserver d'autres FQDN (www.foo.tld) qui se trouvent, eux, à l'extérieur.

Pistes

[user]
name = Matthias DUGUE
email = mdugue@clever-age.com
[color]
ui = auto
[alias]
st = status -sb
co = checkout
ci = commit
oops = commit --amend -C HEAD
@m4dz
m4dz / README.md
Last active December 16, 2015 13:49
DOM events mouse style detection in <canvas/> with heatmaps - Generic lib implementation

Problem : you can't attach DOM style mouse events (over, out, click…) on elements drawn onto a element.

Solution : Heatmaps ! When drawing onto the <canvas/>, do the same onto a "hidden" map canvas that will NEVER be inserted into the DOM. Assign random colors to the elements drawn to the map, then add regular DOM events to the visible element. When an event fire up, compare coordinates of the mouse in the <canvas/>, to the map, detect the color to find the element on which the event apply, then fire the custom event stack.

So simple isn't it ? Hack you said ;) ?

Wait… It's just JavaScript !