Skip to content

Instantly share code, notes, and snippets.

@StephaneTrebel
StephaneTrebel / 99-noto-mono-color-emoji.conf
Created November 10, 2023 14:33 — forked from yzhernand/99-noto-mono-color-emoji.conf
Noto Emoji Color fontconfig for Konsole
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!--
Noto Mono + Color Emoji Font Configuration.
This config seems to ensure that *all* monospace fonts are affected without breaking
<code> blocks elsewhere. The significant change appears to be setting binding="weak"
on line 22.
Currently the only Terminal Emulator I'm aware that supports colour fonts is Konsole.
@StephaneTrebel
StephaneTrebel / passgitgpg.md
Created January 3, 2023 14:53 — forked from flbuddymooreiv/passgitgpg.md
Setting up pass on git with a gpg key

The following shell transcript shows how to:

  • Create a GPG key
  • Create a pass database
  • Add git support to the pass database
  • Create a remote git repository
  • Push the pass database to the remote git repository
  • Fetch and display your passwords from another host

It is assumed that the pass package has been installed on both the first and second computers.

@StephaneTrebel
StephaneTrebel / commit-msg.sh
Last active October 21, 2022 06:01
git commitmsg hook: Idempotently add ticket number in the footer part of a commit message
#!/bin/bash
#
# DESCRIPTION:
# Add the ticket identifier found in the branch name in the footer part of
# the commit message. This action is idempotent (meaning if the ticket is already
# in the message, it will not be added again).
# Please note that this apply to «git commit» and its variations
# (most notably «--amend»). Il will not apply to «reword» actions during an
# interactive rebase, for instance.
#

Reading data before application startup in Angular 2

In this demonstration I will show you how to read data in Angular2 final release before application startup. You can use it to read configuration files like you do in other languages like Java, Python, Ruby, Php.

This is how the demonstration will load data:

a) It will read an env file named 'env.json'. This file indicates what is the current working environment. Options are: 'production' and 'development';

b) It will read a config JSON file based on what is found in env file. If env is "production", the file is 'config.production.json'. If env is "development", the file is 'config.development.json'.

@StephaneTrebel
StephaneTrebel / .bashrc
Created September 19, 2017 08:21
Git branch in prompt
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\] \[\033[01;34m\]\w\[\033[31m\]$(__git_ps1)\[\033[00m\]\$ '
@StephaneTrebel
StephaneTrebel / Dockerfile
Created August 11, 2017 08:07
Generic Ionic2 dockerfile
FROM ubuntu:trusty
MAINTAINER Stéphane Trebel <myemail@email.com>
ENV DEBIAN_FRONTEND=noninteractive \
ANDROID_HOME=/opt/android-sdk-linux \
NODE_VERSION=8.2.1 \
SONAR_SCANNER=3.0.0.702-linux \
SONAR_URL=http://localhost:9000 \
DISPLAY=":1"
@StephaneTrebel
StephaneTrebel / Dockerfile
Created August 11, 2017 08:05
Generic node8 dockerfile
FROM ubuntu:zesty
MAINTAINER Stephane Trebel <myemail.email.com>
ENV DEBIAN_FRONTEND=noninteractive \
NODE_VERSION=8.2.1 \
SONAR_SCANNER=3.0.0.702-linux \
SONAR_URL=http://localhost:9000
# Setup environment
ENV PATH ${PATH}:/opt/sonar-scanner/bin
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"sourceMap": true,
"removeComments": true,
"lib": ["es2015", "dom"],
"strict": true,
"noUnusedLocals": true,
{
"extends": "tslint:recommended",
"rules": {
"object-literal-key-quotes": [true, "as-needed"],
"quotemark": "single",
"arrow-parens": [true, "ban-single-arg-parens"],
"ordered-imports": false,
"object-literal-sort-keys": false,
"no-var-requires": false,
"max-classes-per-file": [true, 2]
@StephaneTrebel
StephaneTrebel / commitmsg.sh
Last active August 11, 2017 07:48
Automagically add the JIRA branch name to the commit message
#!/bin/sh
# Add "commitmsg": "./commitmsg.sh ${GIT_PARAMS}" to your package.json and use Husky to add it as a githook
TICKET=$(git symbolic-ref HEAD | rev | cut -d/ -f1 | rev | grep -o -E "[A-Z]+-[0-9]+")
if [ -n "${TICKET}" ]; then
# sed -e "1s/^/[${TICKET}] /" $1
echo -n "[$TICKET]"' '|cat - "$1" > /tmp/out && mv /tmp/out "$1"
fi