Skip to content

Instantly share code, notes, and snippets.

@btfak
btfak / useHexo.md
Created May 26, 2016 09:41
How to use Hexo and deploy to GitHub Pages
@akrylysov
akrylysov / asyncio_producer_consumer.py
Last active June 30, 2024 09:20
Python 3 asyncio basic producer / consumer example
import asyncio
import random
q = asyncio.Queue()
async def producer(num):
while True:
await q.put(num + random.random())
await asyncio.sleep(random.random())
Please bear in mind this is for a Debian environment - specifically Jessie so directive in apache
vhost will differ if you're not using apache-2.4.
I followed the instructions for the development environment (N.B. DO NOT use `test` as the account
for `createsuperuser` as this will break `loaddate test_data`):
sudo mkdir /usr/share/readthedocs
sudo chown your_username readthedocs
sudo apt-get install build-essential python-dev libxml2-dev libxslt1-dev zlib1g-dev virtualenv git
cd /usr/share/
@subelsky
subelsky / large_redshift_tables.sql
Created April 18, 2014 17:39
Quick SQL command to find large tables in redshift
-- based on http://stackoverflow.com/questions/21767780/how-to-find-size-of-database-schema-table-in-redshift
SELECT name AS table_name, ROUND((COUNT(*) / 1024.0),2) as "Size in Gigabytes"
FROM stv_blocklist
INNER JOIN
(SELECT DISTINCT id, name FROM stv_tbl_perm) names
ON names.id = stv_blocklist.tbl
GROUP BY name
ORDER BY "Size in Gigabytes" DESC