Skip to content

Instantly share code, notes, and snippets.

View Teckden's full-sized avatar

Denys Ivanchuk Teckden

View GitHub Profile
import * as types from '../actions/types';
export const addTodo = text => dispatch => dispatch({type: types.ADD_TODO, text});
export const deleteTodo = id => dispatch => dispatch({type: types.DELETE_TODO, id});
export const editTodo = (id, text) => dispatch => dispatch({type: types.EDIT_TODO, id, text});
export const completeTodo = id => dispatch => dispatch({type: types.COMPLETE_TODO, id});
export const clearCompleted = () => dispatch => dispatch({type: types.CLEAR_COMPLETED});
export const showAll = () => dispatch => dispatch({type: types.SHOW_ALL});
export const showActive = () => dispatch => dispatch({type: types.SHOW_ACTIVE});
export const showCompleted = () => dispatch => dispatch({type: types.SHOW_COMPLETED});
@Teckden
Teckden / gist:51c37c97d49f045f2a8fa4b6638b1008
Created September 4, 2017 09:40 — forked from showaltb/gist:8542626
Install PhantomJS on Amazon AMI x86_64
# download and unpack distribution
wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.6-linux-x86_64.tar.bz2
tar xf phantomjs-1.9.6-linux-x86_64.tar.bz2
# copy binary
cd phantomjs-1.9.6-linux-x86_64
cp bin/phantomjs /usr/local/bin
@Teckden
Teckden / pg_import_csv_to_heroku.sh
Created March 16, 2017 11:19 — forked from jboesch/pg_import_csv_to_heroku.sh
Importing a CSV dump of Postgres data into Heroku
# You have your csv data and it looks like so... It's in a file named "my_data.csv" and we want to import it into a table named "my_things".
"1", "Something", "0.50", "2013-05-05 10:00:00"
"2", "Another thing", "1.50", "2013-06-05 10:30:00"
# Now you want to import it, go to the command line and type:
$ PGPASSWORD=PWHERE psql -h HOSTHERE -U USERHERE DBNAMEHERE -c "\copy my_things FROM 'my_data.csv' WITH CSV;"
# Voila! It's impoted. Now if you want to wipe it out and import a fresh one, you would do this:
@Teckden
Teckden / install-packer-on-mac-os.sh
Created March 15, 2017 11:37 — forked from akora/install-packer-on-mac-os.sh
Install packer on Mac OS
curl -O -L https://dl.bintray.com/mitchellh/packer/packer_0.7.5_darwin_amd64.zip
unzip packer_0.7.5_darwin_amd64.zip
sudo mv packer_0.7 /usr/local/packer
sudo chown $USER /usr/local/packer/
# then update your .bash_profile with the new path e.g.:
# export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/local/packer:$PATH"