Skip to content

Instantly share code, notes, and snippets.

View prxg22's full-sized avatar
🍋

Paulo Ricardo Xavier Giusti prxg22

🍋
View GitHub Profile
@prxg22
prxg22 / types.ts
Created February 5, 2024 19:34
Graph db types
export type DBGraph = { [e: string]: { [k: string]: any } }
export type DBGraphRelations<G extends DBGraph = DBGraph> = {
[s in StringKeys<G>]: { [t in StringKeys<G>]?: { [k: string]: any } }
}
export type DBGraphEntityMockRelation<
G extends DBGraph,
E extends StringKeys<G>,
> = {
[S in E]: {
@prxg22
prxg22 / npm-prerelease.md
Created April 20, 2020 15:07 — forked from schmich/npm-prerelease.md
Publish a prerelease package to NPM
  • Update package.json, set version to a prerelease version, e.g. 2.0.0-rc1, 3.1.5-rc4, ...
  • Run npm pack to create package
  • Run npm publish <package>.tgz --tag next to publish the package under the next tag
  • Run npm install --save package@next to install prerelease package
# NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
# GIT
git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
@prxg22
prxg22 / git-install-completion
Created June 20, 2018 01:13
git install completion
URL="https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash"
PROFILE="$HOME/.profile"
echo "Downloading git-completion..."
if ! curl "$URL" --silent --output "$HOME/.git-completion.bash"; then
echo "ERROR: Couldn't download completion script. Make sure you have a working internet connection." && exit 1
fi
@prxg22
prxg22 / airports.json
Last active September 10, 2018 08:13 — forked from tdreyno/airports.json
JSON data for airports and their locations
This file has been truncated, but you can view the full file.
[
{
"code": "AAA",
"lat": "-17.3595",
"lon": "-145.494",
"name": "Anaa Airport",
"city": "Anaa",
"state": "Tuamotu-Gambier",
"country": "French Polynesia",
"woeid": "12512819",