Skip to content

Instantly share code, notes, and snippets.

Avatar

Fabien Dehopré FabienDehopre

View GitHub Profile
@FabienDehopre
FabienDehopre / tslint.json
Created Feb 15, 2019
My Angular Project TsLint configuration
View tslint.json
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rulesDirectory": ["codelyzer", "rxjs-tslint"],
"rules": {
"member-access": [true, "no-public"],
"member-ordering": [
true,
{
"order": ["static-field", "instance-field", "static-method", "instance-method"]
}
@FabienDehopre
FabienDehopre / install.sh
Last active Sep 29, 2020
My Ubuntu Install Script (install all my needed packages)
View install.sh
#!/bin/bash
sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get install -y curl
release=$(lsb_release -cs)
pkg_list=(git git-flow zsh zsh-doc openssh-server net-tools mc dotnet-sdk-2.1.105 nodejs yarn)
echo "Configuring APT repositories..."
if [[ $release == "trusty" ]]
View dynamically-size-elements-with-pure-css.markdown
@FabienDehopre
FabienDehopre / HarlemShakeScript.js
Last active May 18, 2016
Make an unsecure website dance
View HarlemShakeScript.js
/*
(from Troy Hunt's article https://www.troyhunt.com/understanding-csp-the-video-tutorial-edition/)
1. Go to Google Chrome
2. Go to any website (works cool on facebook)
3. Right click anywhere -> Inspect Element
4. Click on the rightmost "Console" tab.
5. Copy paste the following * into the console.
6. Make sure the volume isn't too loud!
6. Press Enter.
@FabienDehopre
FabienDehopre / IPAddressExtensions.cs
Last active Apr 6, 2016
IPAddress class extension method which indicates whether an IP address is routable or not.
View IPAddressExtensions.cs
public static class IPAddressExtensions
{
/// <summary>
/// Indicates whether the <see cref="IPAddress"/> is a routable address or not.
/// </summary>
/// <param name="ipAddress"></param>
/// <remarks>A null or empty string passed as the ipAddress will return true. An invalid ipAddress will be returned as true. </remarks>
/// <returns><c>true</c> if the <see cref="IPAddress"/> is a private (non-routable) address; <c>false</c> otherwise.</returns>
public static bool IsNonRoutableIpAddress(this IPAddress ipAddress)
{
@FabienDehopre
FabienDehopre / Identifier.cs
Last active Jan 27, 2021
Validate C# identifier name
View Identifier.cs
using System;
using System.Linq;
using System.Text.RegularExpressions;
public static class IdentifierExtensions
{
// definition of a valid C# identifier: http://msdn.microsoft.com/en-us/library/aa664670(v=vs.71).aspx
private const string FORMATTING_CHARACTER = @"\p{Cf}";
private const string CONNECTING_CHARACTER = @"\p{Pc}";
private const string DECIMAL_DIGIT_CHARACTER = @"\p{Nd}";