Skip to content

Instantly share code, notes, and snippets.

View amwebexpert's full-sized avatar

André Masson amwebexpert

View GitHub Profile
@amwebexpert
amwebexpert / PowerlineForTerminal.md
Created April 2, 2021 15:06 — forked from DucNgn/PowerlineForTerminal.md
Powerline style for terminal OSX

Installing and configuring Powerline-style command line tools for developers (OSX)

Intro:

For every developer, terminal is their weapon, so why don't you customize it to become a powerful, and a beautiful weapon?

Powerline style refers to a terminal style that helps developer to keep track of their workflow easily, allows them to have perfect visual on current directories and new changes. It is also git recognizable, and failure detector that will help your development process becomes more interact and much faster.

In this guideline, I will introduce you with 2 smart shells: Zsh and Fishshell. Both are perfect for the development jobs due to its rich of resources, and user-friendly.

Note:

@amwebexpert
amwebexpert / async-await.js
Created January 22, 2020 23:09 — forked from wesbos/async-await.js
Simple Async/Await Example
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works
const axios = require('axios'); // promised based requests - like fetch()
function getCoffee() {
return new Promise(resolve => {
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee
});
}
@amwebexpert
amwebexpert / MainTest.kt
Last active August 11, 2019 14:20
Kotlin, data classes, interfaces, implémentations par défaut
/**
* @see https://chroniquedundev.wordpress.com/2019/08/10/kotlin-data-class-et-interfaces/
*/
data class Table(override var label: String): TruncateableLabel
data class Chair(var description: String, var quantity: Int): TruncateableLabel {
override val label: String
get() {
return "$quantity - $description"
@amwebexpert
amwebexpert / js-extensions.js
Created September 21, 2017 12:01
Some usefull javascript prototype methods without any javascript framework dependencies
Date.prototype.yyyymmddhhmmss = function() {
var yyyy = this.getFullYear();
var mm = this.getMonth() < 9 ? "0" + (this.getMonth() + 1) : (this.getMonth() + 1); // getMonth() is zero-based
var dd = this.getDate() < 10 ? "0" + this.getDate() : this.getDate();
var hh = this.getHours() < 10 ? "0" + this.getHours() : this.getHours();
var min = this.getMinutes() < 10 ? "0" + this.getMinutes() : this.getMinutes();
var ss = this.getSeconds() < 10 ? "0" + this.getSeconds() : this.getSeconds();
return "".concat(yyyy).concat("-").concat(mm).concat("-").concat(dd).concat(" ").concat(hh).concat(":").concat(min).concat(":").concat(ss);