Skip to content

Instantly share code, notes, and snippets.

@Klerith
Klerith / pasos-node-ts-jest.md
Created August 19, 2023 18:35
Note + TypeScript + Jest = Testing

Pasos para configurar Jest con TypeScript, en Node

Documentación oficial sobre Jest

  1. Instalaciones de desarrollo (super test es útil para probar Express)
npm install -D jest @types/jest ts-jest supertest
For a more organised and more update list please visit https://github.com/RayZz-/LCU-Arguments
This list will no longer be updated please refer to the repo linked above
These are known command line arguments for the LCU(including helper) some maybe outdated
or overtime may become outdated or some information maybe incorrect
if you would like to contribute please comment with updated information.
Usage example:
--app-name=kappa
@samanzamani
samanzamani / gist:7ab3046ae1f94348d852bde959349f92
Last active May 5, 2024 09:35
لیست کامل تمام شهرها و استان های ایران
[
{
"province": "اردبیل",
"cities": [
"اردبیل",
"اصلاندوز",
"آبی بیگلو",
"بیله سوار",
"پارس آباد",
"تازه کند",
@jahe
jahe / jpa-cheatsheet.java
Last active May 5, 2024 09:34
JPA Cheatsheet
/*
JPA (Java Persistence API)
Transaction Management with an Entity-Mananger:
---
entityManager.getTransaction().begin();
entityManager.persist(<some-entity>);
entityManager.getTransaction().commit();
entityManager.clear();
@deefdragon
deefdragon / migrate.configmap.yaml
Last active May 5, 2024 09:33
Migrating Kubernetes PVC/PVs from one storage class to another
apiVersion: v1
kind: ConfigMap
metadata:
# any name can be used; Velero uses the labels (below)
# to identify it rather than the name
name: change-storage-class-config
# must be in the velero namespace
namespace: velero
# the below labels should be used verbatim in your
# ConfigMap.
@acidtib
acidtib / readme.md
Created August 28, 2023 17:56
kamal + github actions

Example of Kamal deployment from Github Actions.

Add your applications .env variables to the Github repo as a repository secret, you can find this under the repo settings => secrets and variables => actions

https://github.com/username/repo_name/settings/secrets/actions

you are going to need an ssh private key that your deployment server is aware of (add public key to servers .ssh/authorized_keys) and add the ssh private key as a repo secret

create action workflows

@apisandipas
apisandipas / share-urls.md
Last active May 5, 2024 09:30 — forked from chrisjlee/drupal-views-share-global-text-field
Share url's for Facebook, Twitter, Pinterest and Linkedin with just get variables

Creating share buttons with just URL's

Twitter

http://twitter.com/share?text=<TITLE>&url=<URL>

E.g. http://twitter.com/share?text=This+is+google+a+search+engine&url=https%3A%2F%2Fwww.google.com

Facebook

http://www.facebook.com/sharer.php?u=&amp;p[title]=

@mikaello
mikaello / git-commit-change-author-email.md
Last active May 5, 2024 09:28
Change Git commit author / email in existing commits

Docs: https://github.com/newren/git-filter-repo/blob/main/Documentation/converting-from-filter-branch.md#changing-authorcommittertagger-information and https://htmlpreview.github.io/?https://github.com/newren/git-filter-repo/blob/docs/html/git-filter-repo.html#_filtering_of_names_amp_emails_see_also_name_callback_and_email_callback

git filter-repo \
  --email-callback ' return email if email != b"OLD_EMAIL" else b"NEW_EMAIL" ' \
  --name-callback 'return name.replace(b"OLD_AUTHOR", b"NEW_AUTHOR")' \
  --force \
  --refs HEAD~<NUMBER_OF_COMMITS>..<BRANCH_NAME> # This line is optional, remove to do the change in all commits (will rewrite complete history)
@edy555
edy555 / RiehmanZetaRecursion.ipynb
Last active May 5, 2024 09:26
今度はリーマンゼータ関数の漸化式での計算をPythonで試してみた。前回のはこちら。http://nbviewer.jupyter.org/gist/edy555/9988efd898d11fba2540
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rkttu
rkttu / .bashrc
Last active May 5, 2024 09:25
How to initialize oh-my-posh with bash (macOS), bash (WSL, Ubuntu), cmd, zsh and pwsh
# for bash (macOS)
POSH_THEMES_PATH=$(brew --prefix oh-my-posh)/themes
eval "$(oh-my-posh completion bash)"
eval "$(oh-my-posh init bash --config "$POSH_THEMES_PATH"/clean-detailed.omp.json | sed 's|\[\[ -v MC_SID \]\]|[[ -n "$MC_SID" ]]|')"