Skip to content

Instantly share code, notes, and snippets.

View delqn's full-sized avatar
👓
Reviewing your code...

Delyan Raychev delqn

👓
Reviewing your code...
View GitHub Profile
@delqn
delqn / postgres_queries_and_commands.sql
Created March 10, 2017 08:00 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'

Keybase proof

I hereby claim:

  • I am delqn on github.
  • I am delqn (https://keybase.io/delqn) on keybase.
  • I have a public key ASB-8ERlY9jj4GW2E-Dy4xg5WePFZZ9lxAoPL912Rcjycgo

To claim this, I am signing this object:

@delqn
delqn / gist:d3d172aefa4d3e6098d8215bb3451358
Created May 3, 2016 10:31 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@delqn
delqn / beautiful_idiomatic_python.md
Created March 22, 2016 19:02 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@delqn
delqn / on_stateful_code.txt
Created March 8, 2016 21:08 — forked from josteink/on_stateful_code.txt
On why stateful code is bad
On why stateful code is bad
===========================
STUDENT: Sir, can I ask a question?
TEACHER: Yes!
STUDENT: How do you put an elephant inside a fridge?
TEACHER: I don't know.
STUDENT: It's easy, you just open the fridge and put it in. I have another question!
TEACHER: Ok, ask.
STUDENT: How to put a donkey inside the fridge?

Keybase proof

I hereby claim:

  • I am delqn on github.
  • I am delqn (https://keybase.io/delqn) on keybase.
  • I have a public key whose fingerprint is 67BA 5257 A9B2 3C26 8914 A330 4F42 0739 284F 270F

To claim this, I am signing this object:

@delqn
delqn / cocoa-screen.m
Created September 7, 2013 23:22
Logitech T400 middle mouse button working as B2 in Plan9
changeset: 3459:62c46799f75a
tag: tip
user: delyan@raychev.org
date: Sat Sep 07 16:14:14 2013 -0700
files: src/cmd/devdraw/cocoa-screen.m
description:
Convert Logitech T400 L_Meta mouse button to middle mouse button
diff -r 8c459ad6cc84 -r 62c46799f75a src/cmd/devdraw/cocoa-screen.m
<link rel="stylesheet" type="text/css" href="css/corners.css">
<link rel="stylesheet" type="text/css" href="/jsp/bofa/css/colorbox.css">
<script language="JavaScript" type="text/javascript" src="/jsp/bofa/js/core.js"></script>
<script language="JavaScript" type="text/javascript" src="/jsp/bofa/js/jquery.colorbox-min.js"></script>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">