Skip to content

Instantly share code, notes, and snippets.

View NeniEmSu's full-sized avatar
🏠
Working from home

Emmanuel Sulku Neni NeniEmSu

🏠
Working from home
View GitHub Profile
const testString = 'hello';
const reverse = (s) => {
let arr = Array.from(s),
left = 0,
right = arr.length - 1;
while (left < right) {
[arr[left], arr[right]] = [arr[right], arr[left]]
left++
right--
// For a detailed explanation regarding each configuration property, visit:
// https://jestjs.io/docs/en/configuration.html
// declaring node_env globally
process.env.NODE_ENV = 'testing';
// script for package.json
"test": "cross-env NODE_ENV=testing jest --watch --verbose --runInBand",
module.exports = {
// All imported modules in your tests should be mocked automatically
@NeniEmSu
NeniEmSu / eslint_prettier_airbnb.md
Created October 9, 2020 15:03 — forked from bradtraversy/eslint_prettier_airbnb.md
ESLint, Prettier & Airbnb Setup

VSCode - ESLint, Prettier & Airbnb Setup

1. Install ESLint & Prettier extensions for VSCode

Optional - Set format on save and any global prettier options

2. Install Packages

npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node

Heroku Cheet Sheet

heroku login # login once
heroku create [name] # Initializes heroku app and adds remote.
heroku addons:create heroku-postgresql:[plane-name] -app [project-name] # add a postgres db addon to your heroku app where plane-name = hobby-dev
heroku logs [--tail] # Shows heroku server terminal
heroku pg:psql # connect to heroku addon database server
heroku config # shows heroku environment variables
 - heroku config:set clown=fiesta # set a config variable
@NeniEmSu
NeniEmSu / Caesars-Cipher.js
Last active August 30, 2020 12:50
Write a function which takes a ROT13 encoded string as input and returns a decoded string. All letters will be uppercase. Do not transform any non-alphabetic character (i.e. spaces, punctuation), but do pass them on.
function rot13(str) {
const splitStr = str.split('')
let finalArr = []
for(let i = 0; i < splitStr.length; i++){
for(let j = 0; j < splitStr[i].split('').length; j++){
const currentValueCode
= splitStr[i]
.split('')[j]
.charCodeAt()
#bg {
background: url("~assets/img/bg-img.jpg") no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
position: relative;
background-color: grey;
&:before {