Skip to content

Instantly share code, notes, and snippets.

View zapidan's full-sized avatar

Daniela Zapata Riesco zapidan

  • M1 Finance
  • Chicago, Illinois
View GitHub Profile
@zapidan
zapidan / scala-enums.scala
Created January 14, 2018 19:31
scala enums
import Test.{doWhat, findColorById, findColorById2, findColorByName}
import TrafficLightColorById.{Green, Red, TrafficLightColorById, Yellow}
import scala.util.Try
/*
Enums (id, name) with default id incremental
*/
object TrafficLightColor extends Enumeration {
val Red = Value(0, "RED")
@zapidan
zapidan / server.js
Created November 6, 2015 17:00
Simple Express Server that serves files on /public folder
var path = require('path');
var express = require('express');
var bodyParser = require('body-parser');
var app = express();
app.set('port', (process.env.PORT || 3000));
app.use('/', express.static(path.join(__dirname, 'public')));
app.use(bodyParser.json());
@zapidan
zapidan / git-change-author
Last active June 19, 2023 13:21
Change previous commits author/email with filter-branch
## Make sure your local repo settings are correct
git config --local --list
git config --local user.name "author name"
git config --local user.email "name@example.com"
## Change previous n commits
git rebase -i HEAD~n
# choose the commits to change by adding 'pick' or 'reword' (only for changing the message)
git commit --amend --author="Author Name <email@address.com>"
# change first commit in repo
@zapidan
zapidan / gist:14ca24cfc36716ba5699
Created July 10, 2015 14:37
Fix NPM/Node installation issues
sudo brew uninstall node
brew update
brew upgrade
brew cleanup
brew install node
sudo chown -R $(whoami) /usr/local
brew link --overwrite node
sudo brew postinstall node