This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for file in *; do | |
iconv -f iso-8859-1 -t utf-8 $file > $file.new | |
mv $file.new $file | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Author: Nikolaos Dimopoulos | |
# Based on code by Remigijus Jarmalavičius | |
# Checks the files to be committed for the presence of print_r(), var_dump() and die() | |
# The array below can be extended for further checks | |
# Bruno's modifications: | |
# - Adds some JS checkup | |
# - Enable checkup in more languages | |
# - Fix the bug on the git status command |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2017-06-14T14:59:25.593Z","extensionVersion":"v2.8.1"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard | |
# https://robots.thoughtbot.com/tmux-copy-paste-on-os-x-a-better-future | |
# To copy/paste on OSX just brew install the following | |
# brew install reattach-to-user-namespace | |
set-option -g default-command "reattach-to-user-namespace -l zsh" | |
# load paste buffer to tmux | |
bind ] run "reattach-to-user-namespace pbpaste | tmux load-buffer - && tmux paste-buffer" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git rebase --onto master HEAD~N | |
# Where: n = numbers of commit until where the repos are the same |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use vim keybindings in copy mode | |
setw -g mode-keys vi | |
# start selecting text typing 'v' key (once you are in copy mode) | |
bind-key -t vi-copy v begin-selection | |
# copy selected text to the system's clipboard | |
bind-key -t vi-copy y copy-pipe "xclip -sel clip -i" | |
# MacOS specific settings (clipboard mostly) | |
if-shell 'test "$(uname -s)" = Darwin' 'source-file ~/.tmux-macos.conf' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
head -1 $2 > $1 | |
for filename in ${@:2}; do sed 1d $filename >> $1; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const Joi = require('joi') | |
module.exports = Joi.object().keys({ | |
username: Joi.string(), | |
rating: Joi.number().integer().min(1).max(5).default(5), | |
email: Joi.string().email().required() | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const schema = require('./rating-schema') | |
const result = schema.validate({ | |
username: 'brunoluiz', | |
rating: 5, | |
email: '[email protected]' | |
}) | |
console.log(result) // result.error will be null | |
// result.error will show an error due to missing e-mail |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = (req, res, next) => { | |
const ratings = Ratings.schema.validate(req.body) | |
if (ratings.error) { | |
return next(ratings.error) | |
} | |
req.parsed = ratings.value | |
return next() | |
} |
OlderNewer