Skip to content

Instantly share code, notes, and snippets.

View FarisMarouane's full-sized avatar

Marouane Faris FarisMarouane

View GitHub Profile

Heap's Algorithm step by step

Take the example of generating the permutations of the array ['a', 'b', 'c', 'd'].

Assume that the function named generate(n, arr) with two parameters: n is the length of the array; and the arr is the array to be dealt with.

And the calling statement would be: generate(4, ['a', 'b', 'c', 'd']);.

There's a for loop inside the algorithm. So:

@Justkant
Justkant / .zshrc
Last active October 2, 2019 10:00
zgen zshrc
# zgen installation
# git clone https://github.com/tarjoilija/zgen.git "${HOME}/.zgen"
# load zgen
source "${HOME}/.zgen/zgen.zsh"
# add android sdk tools & others for osx
export PATH="$PATH:/usr/local/sbin:${HOME}/Library/Android/sdk/platform-tools"
# enable error redirect from react-native app
@claytongulick
claytongulick / template.js
Last active June 25, 2022 23:32
if statement inside string template literals and lit-html.
//a quick example of how to use actual 'if' statements inside template literals,
//without using ternary operator. Sometimes this is cleaner if you have complex conditionals or nested conditionals.
//data param is passed in via render(template(data), this) - if not using lit-html, could be any function
template = (data) => html`
<div id="job_edit" class="modal">
<div class="modal-content">
${
//we're just going to wrap an anonymous inline function here and then call it with some data
(job => { //job here, is just an example, it could be anything, it's passed in below in (data.job)
if(job)
@gjerokrsteski
gjerokrsteski / remove env file from git forever
Last active October 28, 2024 10:37
remove env file from git history forever
echo '.env' >> .gitignore
git rm -r --cached .env
git add .gitignore
git commit -m 'untracking .env'
git push origin master
@khushal87
khushal87 / blog3.md
Last active July 5, 2024 21:37
Linking a custom domain from Google domains to Vercel app

Linking a custom domain to a deployed application is confusing and at times you don't get a route on how to link the domain with the website. 😫

In this article, I will be explaining how to link a Custom domain brought in Google Domains service to an application hosted on Vercel.

Perks of using vercel is that it allows adding domain without any verification unlike Heroku/Netlify, which means you don't have to add your billing details to add a domain to your application. Moreover, it is fast, efficient, and easy to use.😁

What is Vercel?

​Vercel is a deployment and collaboration platform for frontend developers. ​Vercel enables developers to host websites and web services that deploy instantly and scale automatically – all without any configuration. Source - Official Docs