Skip to content

Instantly share code, notes, and snippets.

View felipekm's full-sized avatar
🦈

Felipe Kautzmann felipekm

🦈
View GitHub Profile
@felipekm
felipekm / CHALLENGE.md
Created July 12, 2022 19:59
JS challenge

JavaScript

Sorted Squared Array

Write a function that takes in a non-empty array of integers that are sorted in ascending order and returns a new array of the same length with the squares of the original integers also sorted in ascending order.

Print the output like this: INPUT [1, 2, 3..] > OUTPUT [1, 4, 9..]

Sample Input

 array = [1, 2, 3, 5, 6, 8, 9]
Given an array of positive integers representing the values of coins in your possession,
write a function that returns the minimum amount of change (the minimum sum of money) that you CANNOT create.
The given coins can have any positive integer value and aren't necessarily
unique (i.e., you can have multiple coins of the same value).
Examples:
```
> {"coins": [5, 7, 1, 1, 2, 3, 22]} -> 20
> {"coins": [1, 1, 1, 1, 1]} -> 6
@felipekm
felipekm / git-commit-best-practices.md
Last active June 3, 2022 19:18
Git Commit Best Practices

Git

Git Best Practices

  1. Test all changes before pushing a PR to the remote branch
  2. Squash commits in pr's
  3. Individual contributor's PR's can be Squashed and Merged on github
  4. Name commits intelligently inside yout reposity. They should follow this format (): . I.e., bug(ModuleName): Fixing merchant logos for....

4.1. Change Types:

@felipekm
felipekm / index.html
Created November 10, 2021 00:30
HTML raw file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Title</title>
<meta name="description" content="The HTML5 Herald">
<meta name="author" content="">
@felipekm
felipekm / gist:784d4fbdf950b5882b96086ff233e9d5
Created July 29, 2021 15:56
Fixes sharp npm package installation
# inside your project folder creates the node_modules with sudo and give it permission
sudo mkdir node_modules/
sudo chmod 777 node_modules/
# now you can install the dependencies with no need of '--unsafe-perm' or '--allow-root'
sudo npm i
@felipekm
felipekm / pm2-describe.sh
Created August 21, 2018 13:39
Validates if a PM2 process is running
#!/bin/bash
sudo pm2 describe login > /dev/null
RUNNING=$?
if [ "${RUNNING}" -ne 0 ]; then
echo "not running"
else
echo "is running"
fi;
sudo ln -s "$(which node)" /usr/bin/node -f
@felipekm
felipekm / LC_TYPE.txt
Last active November 30, 2020 02:36
Linux warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory manpath: can't set the locale; make sure $LC_* and $LANG are correct
vi /etc/environment
# add these lines...
LANG=en_US.utf-8
LC_ALL=en_US.utf-8
@felipekm
felipekm / install-go.sh
Last active September 19, 2020 22:50
Installing Go MacOSX
#/bin/sh
# download gvm
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
# include in path (.bashrc, .zshrc)
export PATH=$PATH:$HOME/.gvm/bin
[[ -s "$HOME/.gvm/scripts/gvm" ]] && source "$HOME/.gvm/scripts/gvm"
export GOPATH=$HOME/Go
@felipekm
felipekm / update_nginx.sh
Created July 31, 2020 19:12
how to update nginx
#!/bin/shell
sudo mkdir /etc/nginx-backup/
sudo cp -r /etc/nginx/* /etc/nginx-backup/
sudo add-apt-repository ppa:nginx/stable
sudo apt-get update
sudo apt-get full-upgrade
sudo nginx -v