Skip to content

Instantly share code, notes, and snippets.

View minademian's full-sized avatar

Mina Demian minademian

View GitHub Profile
@minademian
minademian / gist:4b6de1820f6a2fce346b1429d0aeb03f
Created March 26, 2024 08:53
revert a single commit, not HEAD or HEAD -1
git revert --strategy resolve <commit ID>
@minademian
minademian / launch.json
Created August 10, 2022 11:50
Setting up debugging for Angular 1x+ project in VSCode
// Add under configurations array
{
"name": "ng serve",
"type": "chrome",
"request": "launch",
"preLaunchTask": "debugproj",
"url": "http://localhost:4201/",
"webRoot": "${workspaceFolder}",
"sourceMapPathOverrides": {
"webpack:/*": "${webRoot}/*",
# Add this to your .tmux.conf
set -g mouse on
set-option -g -q mouse on
bind-key -T root WheelUpPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; copy-mode -e; send-keys -M"
bind-key -T root WheelDownPane if-shell -F -t = "#{alternate_on}" "send-keys -M" "select-pane -t =; send-keys -M"
@minademian
minademian / dropdown.md
Last active May 5, 2022 09:00 — forked from citrusui/dropdown.md
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.
@minademian
minademian / exponential_backoff.rb
Created April 21, 2022 13:44 — forked from khamidou/exponential_backoff.rb
Exponential backoff with jitter in Ruby
# Exponential backoff in Ruby
begin
make_request
rescue RequestError => e
if retries <= max_retries
retries += 1
sleep 2 ** retries + rand(20)
retry
else
raise "Timeout: #{e.message}"
const htmlCreator = require("html-creator");
const fs = require("fs/promises");
async function main(args) {
const distPath = args[0];
const stylesList = await loadAssets(".css", distPath);
const scriptsList = await loadAssets(".js", distPath);
const styles = generateAssetsList(stylesList);
@minademian
minademian / import.md
Created November 19, 2021 00:46 — forked from geraldvillorente/import.md
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@minademian
minademian / jest-in-angular.txt
Last active September 23, 2021 05:37
Configuring Jest with Angular 10+
package.json
"jest": {
"testEnvironment": "jsdom"
}
install latest version of Jest
"test": "ng test",
"test-watch": "ng test --watch",
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
mr Marathi
bs Bosnian
ee_TG Ewe (Togo)
ms Malay
kam_KE Kamba (Kenya)
mt Maltese
ha Hausa
es_HN Spanish (Honduras)
ml_IN Malayalam (India)
ro_MD Romanian (Moldova)
npm list <pkg>
create npm-shrinkwrap.json file
npm i
Reference: https://nodejs.org/en/blog/npm/managing-node-js-dependencies-with-shrinkwrap/