Skip to content

Instantly share code, notes, and snippets.

View V-ed's full-sized avatar

Guillaume Marcoux V-ed

  • Canada
  • 21:30 (UTC -04:00)
View GitHub Profile
@V-ed
V-ed / .. Setting up a new Raspberry Pi.md
Last active June 21, 2020 10:09
Raspberry Pi Basic Setup with Pi-hole + OpenVPN installation

Setting up a new headless Raspberry Pi from Scratch : A Quickstart Guide

Note : These instructions have been tested for the Raspberry Pi 3B+ and Raspberry Pi 4B. You can try these on older versions, but I have no guarantee that these instructions will work correctly.

Enabling SSH before the first boot of the Raspberry Pi

To enable SSH in your Raspberry pi before actually booting it up, simply create a file named ssh (with no extension) in the boot partition of your card.

Ref : https://www.raspberrypi.org/documentation/configuration/wireless/headless.md

@V-ed
V-ed / v-ed_java_formatter.xml
Created August 2, 2018 19:55
V-ed's Java Formatter Definition
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
<profile kind="CodeFormatterProfile" name="V-ed" version="12">
<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_new_line_in_empty_annotation_declaration" value="do not 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.comment.new_lines_at_block_boundaries" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
@V-ed
V-ed / prettyPre.js
Last active May 19, 2018 14:48
Makes the <pre> element indent at the level of the children and not at the document's level.
$(function(){
$("pre.code").each(function () {
var html = $(this).html();
var blankLen = (html.split('\n')[0].match(/^[\s\t]+/)[0]).length;
$(this).html($.trim(html.replace(eval("/^[\s\t]{" + blankLen + "}/gm"), "")));
});
});
@V-ed
V-ed / flatten_array.php
Created April 17, 2018 01:23
Flattens a multidimensionnal array in PHP mashing the keys together using a parametized separator.
/**
* Flatten a multi dimension array. For an associative array the child keys are separated by underscore(_) (overwrittable).
*
* Function taken and tweaked from https://gist.github.com/mmohiudd/7474896
* @author Muntasir Mohiuddin
* @param array $a multidimensional array to flatten
* @param array &$r multidimensional array to save values
* @param string $s separator to use between parent and children keys
* @param string $p previous parents separated by the separator
* @return array all flattened keys
@V-ed
V-ed / a. Links
Last active January 23, 2018 05:10
XDebug Configuration for the php.ini file