Skip to content

Instantly share code, notes, and snippets.

View AliBahaari's full-sized avatar
🙃
KIP! (Knowledge Is Power)

Ali Bahaari AliBahaari

🙃
KIP! (Knowledge Is Power)
View GitHub Profile
@bennlee
bennlee / wildcards-in-paths.md
Last active December 19, 2024 08:02
What does the double asterisk(**) mean in the path?

What does the double asterisk(**) mean in the path?

There's two meaning of wildcards in paths for file collections.

  • * is a simple, non-recursive wildcard representing zero or more characters which you can use for paths and file names.
  • ** is a recursive wildcard which can only be used with paths, not file names.

For examples,

  • /var/log/** will match all files in /var/log and all files in all child directories, recursively.
  • /var/log/**/*.log will match all files whose names end in .log in /var/log and all files in all child directories, recursively.
  • /home/*/.bashrc will match all .bashrc files in all user's home directories.

Cheat sheet: JavaScript Array methods

Deriving a new Array from an existing Array:

['■','●','▲'].slice(1, 3)           ['●','▲']
['■','●','■'].filter(x => x==='■')  ['■','■']
    ['▲','●'].map(x => x+x)         ['▲▲','●●']
    ['▲','●'].flatMap(x => [x,x])   ['▲','▲','●','●']
@CMCDragonkai
CMCDragonkai / exporting_modules_functions_from_python_init.md
Last active May 5, 2025 23:51
Exporting Modules and Functions from Python `__init__.py` #python

Exporting Modules and Functions from Python __init__.py

Any directory with __init__.py is considered a package in Python.

Any python files inside a package is considered a module.

Modules contain functions and other bindings that is always exported.

If you are outside the package, and you want to import a module from a package:

@ccnokes
ccnokes / tsconfig-for-npm-sample.json
Created March 8, 2018 03:50
Sample, minimal tsconfig.json for NPM package
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"lib": ["es2017", "es7", "es6", "dom"],
"declaration": true,
"outDir": "dist",
"strict": true,
"esModuleInterop": true
},

Upload images to GitHub

  1. Create a new issue on GitHub.

  2. Drag an image into the comment field.

  3. Wait for the upload process to finish.

  4. Copy the URL and use it in your Markdown files on GitHub.

@smonn
smonn / README.md
Last active March 19, 2025 09:25
How to install git-flow in Windows

How to install git-flow in Windows

When it says "Run command", copy and paste the command part into a CLI, such as Powershell or the command prompt (make sure Git is in the path).

  1. Make sure Git is installed.
  2. From http://gnuwin32.sourceforge.net/packages/util-linux-ng.htm, download the binaries and dependencies zip-files.
  3. Extract them and copy the contents of the bin-folders into your Git installation's bin folder, for example C:\Program Files (x86)\Git\bin. To find out where it is run where.exe git.
  4. Set root directory to where you want to clone git-flow.
  5. Run git clone --recursive git://github.com/nvie/gitflow.git
@dan-djorgi
dan-djorgi / Normalize.css
Created November 11, 2012 17:01
CSS: Normalize.css - Minified
/* Normalize.css
----------------------------------------------- */
article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block;}audio,canvas,video{display:inline-block;*display:inline;*zoom:1;}audio:not([controls]){display:none;height:0;}[hidden]{display:none;}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}html,button,input,select,textarea{font-family:sans-serif;}body{margin:0;}a:focus{outline:thin dotted;}a:active,a:hover{outline:0;}h1{font-size:2em;margin:0.67em 0;}h2{font-size:1.5em;margin:0.83em 0;}h3{font-size:1.17em;margin:1em 0;}h4{font-size:1em;margin:1.33em 0;}h5{font-size:0.83em;margin:1.67em 0;}h6{font-size:0.75em;margin:2.33em 0;}abbr[title]{border-bottom:1px dotted;}b,strong{font-weight:bold;}blockquote{margin:1em 40px;}dfn{font-style:italic;}mark{background:#ff0;color:#000;}p,pre{margin:1em 0;}code,kbd,pre,samp{font-family:monospace,serif;_font-family:'courier new',monospace;font-size:1em;}pre{white-space:pre;white-space:pre-wrap
@keeguon
keeguon / countries.json
Created April 5, 2012 11:11
A list of countries in JSON
[
{name: 'Afghanistan', code: 'AF'},
{name: 'Åland Islands', code: 'AX'},
{name: 'Albania', code: 'AL'},
{name: 'Algeria', code: 'DZ'},
{name: 'American Samoa', code: 'AS'},
{name: 'AndorrA', code: 'AD'},
{name: 'Angola', code: 'AO'},
{name: 'Anguilla', code: 'AI'},
{name: 'Antarctica', code: 'AQ'},