Skip to content

Instantly share code, notes, and snippets.

View digitalashes's full-sized avatar
🤖
Let's commence preparations for rumbling!

Oleksii digitalashes

🤖
Let's commence preparations for rumbling!
View GitHub Profile
CREATE OR REPLACE FUNCTION calculateStoreSalesCycle(_store_id INTEGER)
RETURNS DECIMAL AS $$
DECLARE
dates TIMESTAMP WITH TIME ZONE ARRAY;
timedeltas DECIMAL ARRAY;
BEGIN
SELECT ARRAY(SELECT platform_created_at
INTO dates
FROM stores_order
WHERE stores_order.store_id = _store_id
@digitalashes
digitalashes / faker.txt
Created January 19, 2018 13:25
List of available faker methods
'add_provider',
'address',
'am_pm',
'ascii_company_email',
'ascii_email',
'ascii_free_email',
'ascii_safe_email',
'bank_country',
'bban',
'binary',
@digitalashes
digitalashes / chsh.sh
Last active January 12, 2018 12:10
Change shell
curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh & sudo chsh -s "$(command -v zsh)" "${USER}"
cat /etc/apt/sources.list | perl -ne '$H{$_}++ or print' > /tmp/sources.list && sudo mv /tmp/sources.list /etc/apt/sources.list
def url(self, url):
"""
An internal method for build url
"""
endpoint_url = provider['url'].replace('{format}', data_format)
scheme, netloc, path, qs, fragment = urlsplit(endpoint_url)
query_params = OrderedDict(parse_qsl(qs))
query_params['url'] = url
if self._params:
query_params.update(self._params)
@digitalashes
digitalashes / binary_search.py
Created November 28, 2017 08:37
Binary Search in Python
# iterative implementation of binary search in Python
def binary_search(a_list, item):
"""Performs iterative binary search to find the position of an integer in a given, sorted, list.
a_list -- sorted list of integers
item -- integer you are searching for the position of
"""
@digitalashes
digitalashes / README-Template.md
Created November 17, 2017 15:43 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites