Skip to content

Instantly share code, notes, and snippets.

View PBlanco's full-sized avatar

Peter Blanco PBlanco

View GitHub Profile
@PBlanco
PBlanco / custom
Created June 26, 2017 13:31
Custom Terminal
#git
alias git-clean="git branch --merged | grep -v "\*" | xargs -n 1 git branch -d"
alias up="git pull && npm i && npm run migrate"
alias gs="git status"
# open applications
alias code='open $@ -a "Visual Studio Code"'
# show or hide hidden files
alias showfiles='defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app'
@PBlanco
PBlanco / flightMovieLengthChecker.js
Last active March 29, 2017 16:04
Flight movie length checker interviewcake
//https://www.interviewcake.com/question/python/inflight-entertainment
const flightLength = 5 * 60; //minutes
const movieLengths = [30, 15, 12, 90, 17, 45] // movies length in minutes
function twoMoviesInListEqualFlightLength(flightLength, movieLengths) {
let needMovieOfLength = {};
for (let i = 0; i < movieLengths.length; i++) {
let mlength = movieLengths[i];
if (mlength in needMovieOfLength) {