Skip to content

Instantly share code, notes, and snippets.

View theodorosidmar's full-sized avatar
👨‍💻
☕️

sid theodorosidmar

👨‍💻
☕️
View GitHub Profile
@theodorosidmar
theodorosidmar / nodemon-rails.sh
Created June 6, 2018 19:28
Nodemon and Rails
$ nodemon --watch config -e rb,yml --exec "rails server"
# Package.json
"debug": "node_modules/.bin/nodemon --inspect-brk=0.0.0.0:9229 index.js"
# lauch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
@theodorosidmar
theodorosidmar / SET-DEFAULT-SHELL.md
Last active May 8, 2018 22:58
Set your favorite shell as default

Setting zsh as default

chsh -s $(which zsh)

Setting bash as default

chsh -s $(which bash)
@theodorosidmar
theodorosidmar / crypto.js
Last active May 2, 2018 18:59
Encrypt and decrypt texts to hexadecimal
const crypto = require('crypto')
const algorithm = 'aes-128-cbc'
const key = Buffer.from('5ebe2294ecd0e0f08eab7690d2a6ee69', 'hex')
const iv = Buffer.from('26ae5cc854e36b6bdfca366848dea6bb', 'hex')
exports.encrypt = (text) => {
const cipher = crypto.createCipheriv(algorithm, key, iv)
let crypted = cipher.update(text, 'utf8', 'hex')
crypted += cipher.final('hex')
@theodorosidmar
theodorosidmar / UPTODATEFORK.md
Last active May 1, 2018 02:38 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPOSITORY.git

2. Add remote from original repository in your forked repository:

cd forked-repository
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream