Skip to content

Instantly share code, notes, and snippets.

date close
1-May-12 582.13
30-Apr-12 583.98
27-Apr-12 603.00
26-Apr-12 607.70
25-Apr-12 610.00
24-Apr-12 560.28
23-Apr-12 571.70
20-Apr-12 572.98
19-Apr-12 587.44
@oleg-koval
oleg-koval / .gitignore_global
Created January 22, 2018 00:27
Manage global gitignore
# Vim swap files #
##################
.*.sw?
# Pow and Powder config #
#########################
/.pow*
# RVM and rbenv #
#################
@oleg-koval
oleg-koval / adnetworks.txt
Created January 31, 2018 15:56 — forked from staltz/adnetworks.txt
Ban these domains of ad networks
101com.com, 101order.com, 123found.com, 180hits.de, 180searchassistant.com, 1x1rank.com, 207.net, 247media.com, 24log.com, 24log.de, 24pm-affiliation.com, 2mdn.net, 2o7.net, 360yield.com, 4affiliate.net, 4d5.net, 50websads.com, 518ad.com, 51yes.com, 600z.com, 777partner.com, 77tracking.com, 7bpeople.com, 7search.com, 99count.com, a-ads.com, a-counter.kiev.ua, a.0day.kiev.ua, a.aproductmsg.com, a.collective-media.net, a.consumer.net, a.mktw.net, a.sakh.com, a.ucoz.net, a.ucoz.ru, a.xanga.com, a32.g.a.yimg.com, aaddzz.com, abacho.net, abc-ads.com, absoluteclickscom.com, abz.com, ac.rnm.ca, accounts.pkr.com.invalid, acsseo.com, actionsplash.com, actualdeals.com, acuityads.com, ad-balancer.at, ad-balancer.net, ad-center.com, ad-images.suntimes.com, ad-pay.de, ad-rotator.com, ad-server.gulasidorna.se, ad-serverparc.nl, ad-souk.com, ad-space.net, ad-tech.com, ad-up.com, ad.100.tbn.ru, ad.71i.de, ad.980x.com, ad.a8.net, ad.abcnews.com, ad.abctv.com, ad.about.com, ad.aboutit.de, ad.aboutwebservices.com, ad.abum.com,
@oleg-koval
oleg-koval / some-service-api.yaml
Last active February 2, 2018 12:57
Some Private Resource Service API Template
swagger: "2.0"
info:
version: x.y.z
title: Some Private Resource Service API
host: some-service.domain
basePath: /
schemes:
- http
- https
consumes:
@oleg-koval
oleg-koval / postgres-brew.md
Created February 5, 2018 12:24 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@oleg-koval
oleg-koval / git-tag-delete-local-and-remote.sh
Created February 20, 2018 11:07 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@oleg-koval
oleg-koval / truncate_tables.sql
Created February 23, 2018 13:54
Truncating all tables in a Postgres database
CREATE OR REPLACE FUNCTION truncate_tables(username IN VARCHAR) RETURNS void AS $$
DECLARE
statements CURSOR FOR
SELECT tablename FROM pg_tables
WHERE tableowner = username AND schemaname = 'public';
BEGIN
FOR stmt IN statements LOOP
EXECUTE 'TRUNCATE TABLE ' || quote_ident(stmt.tablename) || ' CASCADE;';
END LOOP;
END;
@oleg-koval
oleg-koval / docker-cleanup-resources.md
Created March 2, 2018 08:51 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@oleg-koval
oleg-koval / cancelable-promise.js
Created March 8, 2018 09:38 — forked from tracker1/cancelable-promise.js
JavaScript Cancelable Promise
var CancelablePromise = (function(){
var cancelledPromiseSymbol = Symbol('PROMISE_CANCELLED');
function createTypeError(message) {
var error = new TypeError(message);
var stack = error.stack.split('\n');
stack.splice(1, 1);
stack[1] = stack[1].replace(/:\d+:\d+\)$/, ')');
error.stack = stack.join('\n');
throw error;