Skip to content

Instantly share code, notes, and snippets.

@nurmdrafi
nurmdrafi / Next.js Project Setup with ESLint, TypeScript, AirBnb, Conventional Commit, Lint Staged and Husky.md
Last active June 17, 2024 19:15
Next.js Project Setup with ESLint, TypeScript, AirBnb, Conventional Commit, Lint Staged and Husky

[https://www.npmjs.com/package/@commitlint/config-conventional]

Install

npm i --save-dev eslint-config-airbnb eslint-config-airbnb-typescript @typescript-eslint/eslint-plugin@latest @typescript-eslint/parser@latest @commitlint/config-conventional @commitlint/cli

// install husky
npm i --save-dev husky

// set script and prepare husky
@fworks
fworks / install-zsh-windows-git-bash.md
Last active July 2, 2024 08:16
Zsh / Oh-my-zsh on Windows Git Bash
powershell (Add-Type '[DllImport(\"user32.dll\")]^public static extern int PostMessage(int hWnd, int hMsg, int wParam, int lParam);' -Name a -Pas)::PostMessage(-1,0x0112,0xF170,2)
@kogcyc
kogcyc / heroku.sh
Created August 14, 2017 22:45
how to install the heroku cli on raspberry pi
wget https://cli-assets.heroku.com/branches/stable/heroku-linux-arm.tar.gz
mkdir -p /usr/local/lib /usr/local/bin
sudo tar -xvzf heroku-linux-arm.tar.gz -C /usr/local/lib
sudo ln -s /usr/local/lib/heroku/bin/heroku /usr/local/bin/heroku
@Dani4kor
Dani4kor / Python FEN chess Validation with regular expression
Last active August 17, 2022 05:32
Python FEN chess Validation with regular expression
def fenPass(fen):
"""
"""
regexMatch=re.match('\s*^(((?:[rnbqkpRNBQKP1-8]+\/){7})[rnbqkpRNBQKP1-8]+)\s([b|w])\s([K|Q|k|q]{1,4})\s(-|[a-h][1-8])\s(\d+\s\d+)$', fen)
if regexMatch:
regexList = regexMatch.groups()
fen = regexList[0].split("/")
if len(fen) != 8:
raise ValueError("expected 8 rows in position part of fen: {0}".format(repr(fen)))
@heyalexej
heyalexej / pytz-time-zones.py
Created November 16, 2016 09:14
list of pytz time zones
>>> import pytz
>>>
>>> for tz in pytz.all_timezones:
... print tz
...
...
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers