Skip to content

Instantly share code, notes, and snippets.

View ppartarr's full-sized avatar
🏠
Working from home

Philippe Partarrieu ppartarr

🏠
Working from home
View GitHub Profile
@ppartarr
ppartarr / git-setup.sh
Last active December 16, 2019 13:40
Script to setup git on a new machine
#!/usr/bin/env bash
ERROR_MESSAGE='Usage: ./git.sh -e "[email protected]" -n "full name" -g "yes|no"'
while getopts :e:n:g: option; do
case ${option} in
e ) EMAIL=${OPTARG};;
n ) NAME=${OPTARG};;
g ) GPG=${OPTARG};;
\? ) echo -e "$ERROR_MESSAGE";;
@ppartarr
ppartarr / encrypt-mail.md
Last active July 23, 2020 08:19
Encrypt email with GPG

How to encrypt an email with the receiver's public key

Prerequisites

  • The receiver's public key. You can usually find this on an OpenPGP keyserver e.g. http://pgp.surfnet.nl/
  • An implementation of the OpenPGP standard such as GnuPG

Import the receiver's public key

gpg --import receiver-key.pub
gpg --keyserver keyserver.example.com --search-key [email protected]
@ppartarr
ppartarr / keybase.md
Created November 1, 2019 21:57
keybase proof

Keybase proof

I hereby claim:

  • I am ppartarr on github.
  • I am ppartarr (https://keybase.io/ppartarr) on keybase.
  • I have a public key whose fingerprint is 42ED 2574 0C90 52B7 4E89 9CC3 D803 F419 9AFF 78A3

To claim this, I am signing this object:

@ppartarr
ppartarr / eclipse-java-style.xml
Created October 29, 2019 16:36
Eclipse Java style formatter
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="17">
<profile kind="CodeFormatterProfile" name="SpacesForTabs" version="17">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_logical_operator" value="insert"/>
@ppartarr
ppartarr / haskell.zsh-theme
Last active May 12, 2021 07:49
zsh haskell theme
function zle-line-init zle-keymap-select {
PROMPT='%{$fg_bold[green]%}λ%{$reset_color%} %{$fg[cyan]%} %n@%m%f %D{%L:%M:%S} %{$fg[cyan]%} %~ $(git_prompt_info)%{$reset_color%} '
zle reset-prompt
}
setopt PROMPT_SUBST
zle -N zle-line-init
zle -N zle-keymap-select
@ppartarr
ppartarr / archdualboot.md
Last active June 12, 2025 13:48
Comprehensive guide to dual boot arch & windows

Dual booting Arch linux & Windows 10

There are already dozens of tutorials to setup an Arch and Windows dual boot - welcome to a dozen + 1. Like most others this is a step by step guide. Unlike most others the steps are ordered in a way that makes sense (starting with the download first - duh!) so you won't have to restart your computer a gazillion times.

I did this on a single SSD Dell XPS 15 with windows 10 preinstalled. It's obviously possible to follow this guide if you're installing Arch onto a different drive or if you're running older hardware. If you run into any problems please be sure to read through the Arch Installation Guide and the Arch Dual boot with Windows wiki.

To get started you will need:

  • a stable internet connection
  • a USB key with 1GB storage
  • a cup of coffee & and a can do attitude
@ppartarr
ppartarr / background.css
Created September 7, 2018 09:23
White space title page with image background
// HTML
/*<div id="parent">
<div id="photo"></div>
<h1 id="title">anything</h1>
</div>*/
// CSS
#parent {
@ppartarr
ppartarr / curl.sh
Created August 24, 2018 16:08
Does server handle CORS preflight OPTIONS request correclty?
# This should response with a 200 OK
curl -X OPTIONS -H "Origin: http://localhost:PORT_NUMBER" -H "Access-Control-Request-Method: GET" --verbose URL
@ppartarr
ppartarr / video.css
Created August 14, 2018 09:59
Fullscreen embedded youtube video
#video {
position: fixed;
top: 50%;
left: 50%;
min-width: 100%;
min-height: 100%;
height: 105vh;
width: auto;
z-index: -1;
transform: translateX(-50%) translateY(-51%);
@ppartarr
ppartarr / docker-clean.sh
Created June 13, 2018 10:36
♻️ Bash script to purge all containers, images, and volumes from docker
#!/bin/bash
# Stop all running containers
docker stop $(docker ps -q)
# Remove all docker containers
docker rm $(docker ps -aq)
# Remove all images
docker rmi $(docker images -q)