Skip to content

Instantly share code, notes, and snippets.

@atafs
atafs / jestdescr.js
Last active March 27, 2018 19:31
JS WebStorm IDE snippets: code to use as alias for more productivity
// jestdescr
// Inserts describe() block
describe('$NAME$', function() {
$END$
});
@atafs
atafs / js-redux-playground.js
Last active March 23, 2018 16:27
Redux way of managing state of the app (store)
// open the dev environment
// https://stephengrider.github.io/JSPlaygrounds/
// create reducer (function)
const reducer = (state = [], action) => {
if (action.type === 'SPLIT_STRING') {
return action.payload.split('');
} else if (action.type === 'ADD_CARACTER') {
// DO NOT MUTATE DATA IN A REDUCER
//state.push(action.payload);
@atafs
atafs / vagrant-provisioning-on-premise-demo01-create-vm.sh
Last active March 8, 2018 14:16
DevOps provisioning with vagrant to build virtual machines for testing code
#!/bin/bash
# install wget, virtualbox and vagrant
brew install wget
# enable in mac preferences to run oracle vm: https://developer.apple.com/library/content/technotes/tn2459/_index.html
brew cask install --force virtualbox
brew cask install vagrant
brew cask install vagrant-manager
# get a fresh Ubuntu 14.04 machine running and create a Vagrantfile
@atafs
atafs / git-advanced-beyond-the-basics
Last active March 8, 2018 20:41
Git Basic and Advanced commands and Setup
# show the history -------------------------------------------------------------------
git hist
# check differences between 2 commits
git difftool <id> HEAD
# modify a file
mate README.md
git diff