Skip to content

Instantly share code, notes, and snippets.

Economic sectors

Based on GICS (Global Industry Classification Standard) with translations and ICB name.

Sources:

  • MSCI
  • justETF
  • French translations come from several websites to cover all my needs
@JackNUMBER
JackNUMBER / _economic_region_countries.md
Last active March 24, 2024 02:08
Economic region for countries
@JackNUMBER
JackNUMBER / install browser extension manually.md
Last active October 21, 2021 21:10
How to install a browser extension manually (outside the store)

How to install a browser extension manually (outside the store)

Why would I do that? In case of an extension is not available on stores, you can install it by yourself. The original repository will probably exists and continue to serve releases.

➡ Go to Github Releases page to download the latest ZIP source files and follow these steps regarding your browser.

Chrome

  1. Unzip the downloaded source files
  2. Open the Extensions page (chrome://extensions/) in the browser
  3. Turn on the "Developer mode" (top-right of the page)
  4. Click on the "Load unpacked" button and select the directory where the built extension is placed
@JackNUMBER
JackNUMBER / .htaccess
Created November 15, 2020 21:56
HTTP to HTTPS + removing WWW subdomain
RewriteEngine On
# rule for forcing https
RewriteCond %{HTTPS} off [OR]
# rule for removing www subdomain
RewriteCond %{HTTP_HOST} ^www\. [NC]
RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
RewriteRule ^ https://%1%{REQUEST_URI} [L,NE,R=301]
@JackNUMBER
JackNUMBER / .bashrc
Last active March 3, 2021 09:59
.bashrc
# change the prompt to user@host:dir and replace project folder by project name
project_path="/home/jacknumber/dev/project-folder/web"
project_name="myProject"
if [ "$color_prompt" = yes ]; then
PS1="${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]$(pwd | sed s#\$project_path#\$project_name#)\[\033[00m\]\$ "
else
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$ "
fi
@JackNUMBER
JackNUMBER / cmder ssh agent startup
Created January 14, 2019 11:16
Load ssh keys on cmder startup
:: First, you have to put ssh keys in right folder. To find it follow this path in Explorer: %USERNAME%/.ssh
:: Next, it depend if you have cmder or cmder_mini. To find cmder folder installation: open cmder and type `echo %CMDER_ROOT%`
:: Go in cmder folder and edit config/user-startup.cmd file
:: For cmder add this line:
@call "%CMDER_ROOT%\vendor\git-for-windows\cmd\start-ssh-agent.cmd"
:: For cmder_mini add this line:
@call "%GIT_INSTALL_ROOT%\cmd\start-ssh-agent.cmd"
@JackNUMBER
JackNUMBER / npm_list
Created October 27, 2017 15:21
npm list package
npm list -g --depth=0
@JackNUMBER
JackNUMBER / sanitize.php
Last active February 17, 2023 14:18
sanitize.php
<?php
function sanitize($string) {
return strtolower(
trim(
preg_replace('~[^0-9a-z]+~i', '-', html_entity_decode(preg_replace('~&([a-z]{1,2})(?:acute|cedil|circ|grave|lig|orn|ring|slash|th|tilde|uml);~i', '$1', htmlentities($string, ENT_QUOTES, 'UTF-8')), ENT_QUOTES, 'UTF-8')),
'-')
);
}
var_dump(sanitize(" Hey oH, c'est l'été ! ")); // "hey-oh-c-est-l-ete"
git grep -l 'original_text' | xargs sed -i 's/original_text/new_text/g'
@JackNUMBER
JackNUMBER / gitconfig
Last active February 3, 2024 00:52
Git config
[alias]
st = status
ci = commit
br = branch
co = checkout
cp = cherry-pick
df = diff --color-words
dfw = diff --color-words --ignore-space-change
last = log -1 --stat
slog = log --pretty=oneline