Skip to content

Instantly share code, notes, and snippets.

View gianlucacandiotti's full-sized avatar

Gianluca Candiotti gianlucacandiotti

  • Wolt
  • Helsinki, Finland
View GitHub Profile
@gianlucacandiotti
gianlucacandiotti / vertical alignment placeholders
Last active February 29, 2016 21:19
Scss placeholders for vertical alignment
%vertical-align {
position: relative;
top: 50%;
transform: translateY(-50%);
}
%absolute-vertical-align {
position: absolute;
top: 50%;
left: 50%;
node_modules/forever/bin/forever stopall
git ls-files --deleted -z | xargs -0 git rm
@gianlucacandiotti
gianlucacandiotti / heroku conf
Created January 19, 2016 03:05
Configure an environment variable in Heroku
heroku config:set variable="value"
"preclean": "if [ ! -d build ]; then mkdir build build/css build/js; fi",
"clean": "rm -rf build/css build/js && mkdir build/css build/js",
@gianlucacandiotti
gianlucacandiotti / npm essential packages
Last active December 20, 2015 01:37
Install common npm packages
npm install --save browserify watchify babelify babel-preset-es2015 babel-preset-react babel-plugin-transform-class-properties react react-dom uglify-js uglifyify
@gianlucacandiotti
gianlucacandiotti / after.sh
Created December 9, 2015 03:42
Vagrant shell provisioning - gvm, go1.5.2 and godep
#!/bin/bash
sudo apt-get install bison -y --force-yes
sudo -u vagrant -H bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
sudo -u vagrant -H bash -c 'echo "source $HOME/.gvm/scripts/gvm" >> $HOME/.bashrc'
sudo -u vagrant -H bash -c 'source $HOME/.gvm/scripts/gvm; gvm install go1.4'
sudo -u vagrant -H bash -c 'source $HOME/.gvm/scripts/gvm; gvm use go1.4 --default'
sudo -u vagrant -H bash -c 'source $HOME/.gvm/scripts/gvm; gvm install go1.5.2'
sudo -u vagrant -H bash -c 'source $HOME/.gvm/scripts/gvm; gvm use go1.5.2 --default'
sudo -u vagrant -H bash -c 'source $HOME/.gvm/scripts/gvm; go get github.com/kr/godep'
// Params to filter
$params = [
'param_1',
'param_2',
'param_3'
];
// an array of objects
$objects_array = [];
$data = [];
#!/bin/bash
files=$(git diff --cached --name-only | grep '\.js$')
# Prevent ESLint help message if no files matched
if [[ $files = "" ]] ; then
exit 0
fi
echo $files | xargs eslint
@gianlucacandiotti
gianlucacandiotti / Mongo ready default.pp
Created May 22, 2015 17:51
Basic default .pp configuration with Mongodb manual install.
# Requires nodejs, stdlib, apt and wget modules.
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
exec { 'apt-get update':
command => 'apt-get update',
timeout => 60,
tries => 3,
}