This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
[alias] | |
changed = "!BASE_REV=`git merge-base master $(git rev-parse --abbrev-ref HEAD)`;git diff --diff-filter=ACMR --name-only $BASE_REV HEAD" | |
check-lint = "!for file in `git changed | grep -e '\\.js$'`;do node_modules/.bin/eslint --config .eslintrc $file;done;" | |
ch = "!git changed" | |
cl = "!git check-lint" | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node_i() { | |
[ -f package-lock.json ] && NPM_I=true; | |
[ -f yarn.lock ] && YARN=true; | |
if [[ $NPM_I = true && $YARN = true ]]; then | |
echo -ne "\033[0;31myou have a package-lock.json and a yarn.lock, you should pick up only one!\033[0m" | |
echo "" | |
else | |
if [ $NPM_I ]; then | |
npm i | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="root"> | |
<div class="full-page-loader"> | |
<img width="200" src="/logo/aiptrade-vertical-color-color.png" alt="AIP.Trade logo" /> | |
</div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
import styled from 'styled-components'; | |
const FullPageLayout = styled<any>(styled.div``)` | |
display: flex; | |
flex-direction: column; | |
`; | |
interface HeaderProps { | |
fixed?: boolean; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
printf -- "\033[32m ============================================= \033[0m\n"; | |
printf -- "\033[32m Good morning dear \033[0m, Ready to rock?\n"; | |
printf -- "\033[32m ============================================= \033[0m\n"; | |
printf -- "Grab a coffee while I check if your repos are all clean\n" | |
STATUS=$(mgitstatus -e --no-stashes --no-upstream .. 1) | |
if [ -z "$STATUS" ] | |
then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Google eyes-catching-design remover | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Will put a lower opacity on the url because since last update, it is too eye-catching for me | |
// @author Martin Ratinaud <[email protected]> | |
// @include /^https?://.*\.google\..*/*/ | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// full article https://medium.com/@martinratinaud/typescript-conditional-types-the-simple-example-8c971c04b6bc | |
// playground https://www.typescriptlang.org/play/#code/PTAEDEFcBttBDATgFwJYGNoFNQHsB2oAFssgA4DOAXCALZYAmqktAdOrrcAAK1Jr5E8AfEgNgyAJ5ksFdIlRlkAWg74maAvGjKpMirqJZlFVLTLZlWAB7xzlgBzoAnAHYAjOgAMAFgBGAGx+6ABQIXo4AJIAKtI4ALygAOTQkgroFEmgAD7JFBaoyEkA3OFxoJEUADJpGBQA8ogAygXIADzRAHygidGgNshY6hTJqemZoAD8oAAKiJyoFFhtAERjdSvdVKAr+dCFK6UhahTIoABmkPjoPaAAFBHbMXEAlE-VtRmNLfvtzzLdeLdADeIVA4NAqHO9wiPXiiRSn0yL1AoIh6NAiCwyEgiEIcwWS1YWIouGgADcsHdEeMki9SuiAL5giFYnF4vKtEohZlAA | |
type IType = 'lyrics' | 'split'; | |
type IsLyricsOrSplit<T> = T extends 'lyrics' ? Promise<"lyrics"> : "split"; | |
const func = (type: IType): IsLyricsOrSplit<IType> => { | |
if (type === 'lyrics') { | |
return Promise.resolve('lyrics'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const puppeteer = require('puppeteer'); | |
const assert = require('assert'); | |
const BASEURL="https://www.something.com" | |
(async () => { | |
const browser = await puppeteer.launch({ | |
headless: process.env.CI === 'true', | |
slowMo: 20, | |
devtools: process.env.CI !== 'true', | |
args: [ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// shuffle an array | |
const shuffle = (array: any[]) => array.sort(() => 0.5 - Math.random()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const timezone: string = Intl.DateTimeFormat().resolvedOptions().timeZone; // Gives "Indian/Mauritius" | |
const timezoneDelayInMinutes: number = new Date().getTimezoneOffset(); // -240 because of GMT+4 |
OlderNewer