Skip to content

Instantly share code, notes, and snippets.

View teserak's full-sized avatar
🏠
Working from home

Konrad Rymczak teserak

🏠
Working from home
View GitHub Profile
@teserak
teserak / openresty-nchan-redis-luarocks.sh
Created January 4, 2020 22:51 — forked from jmealo/openresty-nchan-redis-luarocks.sh
OpenResty + LuaRocks + Nchan + Redis (with password, graph and bloom modules)
#!/bin/sh
apt-get install -y libreadline-dev libncurses5-dev libpcre3-dev \
libssl-dev perl make build-essential git curl \
unzip
git clone https://github.com/RedisLabsModules/password.git /tmp/password
git clone https://github.com/RedisLabsModules/rebloom.git /tmp/rebloom
git clone https://github.com/RedisLabsModules/redis-graph.git /tmp/redis-graph
@teserak
teserak / settings_test_snippet.py
Created August 7, 2019 07:51 — forked from NotSqrt/settings_test_snippet.py
Another shot at this problem ..
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
# Default backend definition. Set this to point to your content
# server.
#
backend web {
.host = "127.0.0.1";
.port = "8080";
}
sub vcl_recv {
@teserak
teserak / pubsub.py
Created January 13, 2019 21:18 — forked from appeltel/pubsub.py
asyncio pubsub example
import asyncio
import random
class Hub():
def __init__(self):
self.subscriptions = set()
def publish(self, message):
@teserak
teserak / gist:bd3ff6d2ceadc413cbeb37619889be6e
Created January 11, 2019 11:02 — forked from pitch-gist/gist:2999707
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@teserak
teserak / PusherService.js
Created December 11, 2018 20:30 — forked from dobromir-hristov/PusherService.js
Busting SPA chunk cache for active users after a deploy
import Pusher from 'pusher-js'
Pusher.logToConsole = process.env.NODE_ENV === 'development'
export const PusherService = new Pusher(process.env.PUSHER_KEY, {
cluster: 'eu',
encrypted: true
})
@teserak
teserak / client.js
Created December 1, 2018 20:56 — forked from hagino3000/client.js
WebSocket with binary data
var socket = null;
function bootstrap() {
// 適当な図形を描画
var c = document.getElementById('mycanvas');
var ctx = c.getContext('2d');
ctx.globalalpha = 0.3;
for(var i=0; i<1000; i++) {
ctx.beginPath();
@teserak
teserak / Private-pypi-howto
Created November 25, 2018 13:46 — forked from Jaza/Private-pypi-howto
Guide for how to create a (minimal) private PyPI repo, just using Apache with directory autoindex, and pip with an extra index URL.
*
@teserak
teserak / psql-with-gzip-cheatsheet.sh
Created September 26, 2018 21:50 — forked from brock/psql-with-gzip-cheatsheet.sh
Exporting and Importing Postgres Databases using gzip
# This is just a cheat sheet:
# On production
sudo -u postgres pg_dump database | gzip -9 > database.sql.gz
# On local
scp -C production:~/database.sql.gz
dropdb database && createdb database
gunzip < database.sql.gz | psql database