Skip to content

Instantly share code, notes, and snippets.

C64/Amiga Scener/Coder

Uğur Özyılmazel vigo

C64/Amiga Scener/Coder
View GitHub Profile
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 Apr 4, 2018
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!

vigo /
Last active Jan 25, 2017
Dotfiles Fever - Linux setup
export PS1=$PS1_ADVANCED
vigo / style.css
Last active Feb 21, 2017
GitHub - Stylish
View style.css
body {
font-family: 'Helvetica';
.markdown-body {
font-family: 'Helvetica';
.octotree_views {
font-family: 'FiraCode-retina';
font-size: .75rem;
vigo / show_opened_tab_count_of_safari.applescript
Last active Jul 19, 2016
Show opened tab count of Safari
View show_opened_tab_count_of_safari.applescript
tell application "Safari"
set total_tab_count to 0
set number_of_windows to number of windows
repeat with x from 1 to number_of_windows
set current_windows_tab_count to number of tabs in window x
set total_tab_count to total_tab_count + current_windows_tab_count
on error error_message
log error_message
end try
You can’t perform that action at this time.