Skip to content

Instantly share code, notes, and snippets.

View Mifrill's full-sized avatar

(Alex/Alexey) Aleksei (Stree’Jacque) Strizhak Mifrill

View GitHub Profile
version: 2
jobs:
build:
working_directory: ~/circleci-demo-ruby-rails
docker:
- image: circleci/ruby:2.4.1-node
environment:
RAILS_ENV: test
PGHOST: 127.0.0.1
PGUSER: root
@Mifrill
Mifrill / Capybara.md
Last active January 1, 2018 12:36 — forked from tomas-stefano/Capybara.md
Capybara cheatsheet

Capybara Actions

# Anchor
click_link 'Save'

# Button
click_button 'awesome'

# Both above
@Mifrill
Mifrill / 01_ts.ts
Last active November 15, 2024 15:03
```
SELECT count(*) FROM TABLE
[
{
"$group": {
"_id": null,
"count": { "$sum": 1 }
}
}
]

CURL

curl -X POST "http://localhost:5000/api/v1/tokens" -d '{"auth": {"email": "editor", "password": "123"}}' -H "Content-Type: application/json"
-------------------------------------------------------------------------------------------
curl -H "Authorization: JWT eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE0OTQ3ODQ1NzAsInN1YiI6Mn0.8QlJbibo2nosDSVnlYtcadJ8VFQFiaBzNueLQDDwCmU" http://localhost:5000/api/v1/pages
-------------------------------------------------------------------------------------------

Postman

find . -name "*.test.ts" -type f -delete
AWS_PROFILE={PROFILE} aws ecs execute-command --cluster cloudos-cluster-sdlc \
--task {TASK_ID} \
--container {CONTAINER_NAME} \
--interactive \
--command "/bin/sh"
docker build . -t <name> --progress=plain --no-cache
@Mifrill
Mifrill / PG::Error: ERROR: new encoding (UTF8) is incompatible
Created January 8, 2018 07:36 — forked from amolkhanorkar/PG::Error: ERROR: new encoding (UTF8) is incompatible
Postgres PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
mifrill@mifrill-desktop:~/Documents$ ls
comments.xls
mifrill@mifrill-desktop:~/Documents$ ruby -v 
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-linux]
mifrill@mifrill-desktop:~/Documents$ gem install roo
Fetching: rubyzip-1.2.1.gem (100%)
Successfully installed rubyzip-1.2.1
Fetching: roo-2.7.1.gem (100%)
Successfully installed roo-2.7.1

git log -1 --pretty=format:"%h - %an, %ar : %s"

git restore --staged <file>
git reset --hard --recurse-submodule

git clean -xfd
git submodule foreach --recursive git clean -xfd
git reset --hard
git submodule foreach --recursive git reset --hard
@Mifrill
Mifrill / docker.md
Last active December 3, 2018 16:18

ElasticSearch

docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:6.0.1

install docker image

sudo docker build -t {image_name} . sudo docker run -i -t -v {project_local_path}:/railgun -p {outPort}:{inside port} {image_name}

example

sudo docker run -i -t -v ~/Desktop/Ruby/railgun/:/railgun -p 5000:3000 railgun-browser

sudo docker ps