Skip to content

Instantly share code, notes, and snippets.

@vladimir-e
vladimir-e / gist:b8b1c52953a6fa98a355
Created August 29, 2014 08:52
A really lowlevel plumbing error occured. Please contact your local Maytag(tm) repair man. #puma #deploy
Set up secret_key_base for current environment in config/secrets.yml
@vladimir-e
vladimir-e / static_classes.handlebars
Created August 30, 2014 12:46
Combining Static and Dynamic CSS Class Names in ember handlebars
{{!-- http://codebrief.com/2012/03/eight-ember-dot-js-gotchas-with-workarounds/ --}}
<div {{bindAttr class="myProperty:dynamicClass :staticClass"}}></div>
Ember.Test.registerHelper('selectFrom',
function(app, selector, value, description) {
// choose an option
find(selector).val(value);
// trigger the change
find(selector).change();
// assert the selected option
equal(find(selector+" option:selected").val(), value, description||"makes the selection");
// promise
return wait();
@vladimir-e
vladimir-e / gist:e6d21e37c01841fc2314
Created September 16, 2014 14:36
Rake db drop create migrate one-liner
bin/rake db:{drop,create,migrate}
@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
@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: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 / 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 / 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 / .eslintrc.js
Created December 28, 2017 05:09
Basic eslint setup
module.exports = {
"env": {
"browser": true,
"es6": true
},
"extends": [
"eslint:recommended",
],
"parserOptions": {
"ecmaFeatures": {