Skip to content

Instantly share code, notes, and snippets.

View vladimir-e's full-sized avatar

Vladimir Evdokimov vladimir-e

View GitHub Profile
@vladimir-e
vladimir-e / machine.js
Created March 31, 2020 16:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@vladimir-e
vladimir-e / machine.js
Created February 24, 2020 16:58
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@vladimir-e
vladimir-e / install.sh
Last active July 9, 2019 21:22
Elixir machine
https://medium.com/coletiv-stories/how-to-automate-your-elixir-projects-deployment-into-aws-9ecbbafb403d
# production server
sudo vim /etc/default/locale
LANG="en_US.UTF-8"
LANGUAGE="en_US.UTF-8"
LC_ALL="en_US.UTF-8"
wget https://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb && sudo dpkg -i erlang-solutions_1.0_all.deb
sudo apt-get update
@vladimir-e
vladimir-e / webpack.config.js
Created December 28, 2017 05:11
Basic webpack setup for phoenix project
const path = require('path');
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const CopyWebpackPlugin = require("copy-webpack-plugin");
module.exports = {
entry: ["./css/web.css", "./js/web.js"],
output: {
path: path.resolve(__dirname, "../priv/static"),
filename: "js/web.js"
},
@vladimir-e
vladimir-e / .eslintrc.js
Created December 28, 2017 05:09
Basic eslint setup
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
],
"parserOptions": {
"ecmaFeatures": {
@vladimir-e
vladimir-e / ubuntu-16.04-web-server.sh
Last active October 14, 2017 20:39
Ubuntu 16.04 web server / Digitalocean
apt-get -y update
apt-get install -y git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties vim mc
# Check locale
locale
# Edit locale file if some ENV variables are missing
vim /etc/default/locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_ALL=en_US.UTF-8
@vladimir-e
vladimir-e / capybara cheat sheet
Created May 30, 2016 05:26 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@vladimir-e
vladimir-e / gist:48787161c4343c041e7e
Created February 25, 2016 12:28
Import module from ember-cli config/environment.js
var path = require('path'),
appConfig = require(path.join(__dirname, '/../config/app'));
@vladimir-e
vladimir-e / pg_dump.sh
Last active August 29, 2015 14:26
Backup and Restore PostgreSQL Database Using pg_dump and psql
# http://www.thegeekstuff.com/2009/01/how-to-backup-and-restore-postgres-database-using-pg_dump-and-psql/
# Backup:
$ pg_dump -U {user-name} {source_db} -f {dumpfilename.sql} -W
# requires to configure md5 auth:
sudo vim /etc/postgresql/9.4/main/pg_hba.conf
# add:
# local all apps md5
@vladimir-e
vladimir-e / gist:4be1367cf5ad208239e1
Created June 29, 2015 10:46
Create Blurry Background Image using ImageMagick
# http://www.seanbehan.com/how-to-create-blurry-background-images-programmatically-from-the-command-line-or-with-ruby
convert path/to/original-image.jpg -channel RGBA -blur 0x5 path/to/blurry-image.jpg