Skip to content

Instantly share code, notes, and snippets.

in a meeting

Uğur Özyılmazel vigo

in a meeting
View GitHub Profile

Keybase proof

I hereby claim:

  • I am vigo on github.
  • I am vigo ( on keybase.
  • I have a public key whose fingerprint is 19CA CF8F 3AB4 06F6 D644 5842 D097 2B1B BE84 BBE4

To claim this, I am signing this object:

vigo / perf-diagnostics.css
Created Jan 23, 2021 — forked from tkadlec/perf-diagnostics.css
CSS used to highlight potential performance issues
View perf-diagnostics.css
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
/* IMAGES */
* Lazy-Loaded Images Check
* ====
vigo /
Created Oct 13, 2020 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
vigo / Rakefile
Last active Oct 4, 2019
Rake task örneği
View Rakefile
task :default => [:menemen_yap]
task :menemen_yap => [:tereyag_al, :yumurta_al, :domates_al, :sivri_biber_al, :sahani_isit, :sebzeleri_pisir, :yumartayi_kir] do
puts "Menemen yapıyıyoruz"
task :tereyag_al => [:bakkala_git] do
puts "Tereyağı alıyoruz"
vigo /
Created Mar 14, 2019 — forked from hakib/
How to Turn Django Admin Into a Lightweight Dashboard
from django.contrib import admin
from django.db.models import Count, Sum, Min, Max, DateTimeField)
from django.db.models.functions import Trunc
from . import models
def get_next_in_date_hierarchy(request, date_hierarchy):

Workflows (States) in Django

I'm going to cover a simple, but effective, utility for managing state and transitions (aka workflow). We often need to store the state (status) of a model and it should only be in one state at a time.

Common Software Uses

  • Publishing (Draft->Approved->Published->Expired->Deleted)
vigo /
Last active Jan 26, 2022
Basic JSON webserver
#!/usr/bin/env python
import sys
import time
import argparse
import os
import json
import socketserver
from http.server import BaseHTTPRequestHandler
class PubSub(object):
Very simple Pub/Sub pattern wrapper
using simplified Redis Pub/Sub functionality.
Usage (publisher)::
import redis
r = redis.Redis()
vigo /
Created Nov 12, 2017 — forked from hrldcpr/
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!