Skip to content

Instantly share code, notes, and snippets.

View egor-lukin's full-sized avatar

Egor Lukin egor-lukin

View GitHub Profile

Keybase proof

I hereby claim:

  • I am lukinegor on github.
  • I am lukin_egor (https://keybase.io/lukin_egor) on keybase.
  • I have a public key ASDPSQ_dm0E-GvqK5O13PVMWqQqkKOBQsI_ADY9CQ1Nd0Ao

To claim this, I am signing this object:

export default {
apiV1LabelsUrl: () => 'http://localhost:3000/api/v1/dashboard/product_labels/labels?app_type=product_labels&store_id=9394594',
apiV1LabelUrl: id => `http://localhost:3000/api/v1/dashboard/product_labels/labels/${id}?app_type=product_labels&store_id=9394594`,
}
@egor-lukin
egor-lukin / S3 buckets copy.md
Created November 15, 2018 13:18 — forked from ushu/S3 buckets copy.md
Copy between S3 buckets w/ different accounts

This is a mix between two sources:

basically the first resource is great but didn't work for me: I had to remove the trailing "/*" in the resource string to make it work. I also noticed that setting the policy on the source bucket was sufficient. In the end these are the exact steps I followed to copy data between two buckets on two accounts

Basically the idea there is:

  • we allowe the destination account to read the source bucket (in the console for the source account)
  • we log as the destination and start the copy
@egor-lukin
egor-lukin / drop.sh
Created August 31, 2018 07:33 — forked from dsci/drop.sh
Dropping all tables in a PostgreSQL database
# first, login with psql
psql -U USERNAME -d databasename
# set output for all queries
\o FILENAME.sql
# run this query
select 'drop table ' || tablename || ' cascade;' from pg_tables;
# logout from psql
@egor-lukin
egor-lukin / postgres_queries_and_commands.sql
Created June 21, 2018 13:07 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@egor-lukin
egor-lukin / queries.sql
Last active April 11, 2018 10:16
useful postgres queries
#database size
SELECT pg_database.datname, pg_size_pretty(pg_database_size(pg_database.datname)) AS size FROM pg_database;
#all tables size
select table_name, pg_relation_size(quote_ident(table_name))
from information_schema.tables
where table_schema = 'public'
order by 2;
@egor-lukin
egor-lukin / Makefile
Created March 1, 2018 04:10 — forked from hallettj/Makefile
Makefile for transpiling with Babel & Flow in a Node app, or in a client- or server-side shared library
# Makefile for transpiling with Babel in a Node app, or in a client- or
# server-side shared library.
.PHONY: all clean
# Install `babel-cli` in a project to get the transpiler.
babel := node_modules/.bin/babel
# Identify modules to be transpiled by recursively searching the `src/`
# directory.
@egor-lukin
egor-lukin / archlinux-virtualbox.sh
Created December 9, 2017 13:36 — forked from GabLeRoux/archlinux-virtualbox.sh
Virtualbox archlinux notes
# sudo /sbin/rcvboxdrv -h
# Unloading modules:
# Loading modules: modprobe: FATAL: Module vboxnetadp not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxnetflt not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxpci not found in directory /lib/modules/4.4.3-1-ARCH
# modprobe: FATAL: Module vboxdrv not found in directory /lib/modules/4.4.3-1-ARCH
# Solution
# from https://forum.antergos.com/topic/818/can-t-run-my-vitualbox/4
@egor-lukin
egor-lukin / slomux.md
Last active September 25, 2017 05:53
Easy flux

Slomux - реализация Flux, в которой, как следует из нвазвания, что-то сломано. Нужно выяснить что здесь сломано

const createStore = (reducer, initialState) => {
  let currentState = initialState
  const listeners = []

  const getState = () => currentState
  const dispatch = action => {
@egor-lukin
egor-lukin / rails http status codes
Created September 9, 2017 13:58 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing