This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body, #contentCol { | |
background-color: #fff !important; | |
} | |
#blueBarDOMInspector > div > div { | |
background-color: orange; | |
border-bottom: 0px; | |
} | |
#pagelet_ego_pane, | |
#pagelet_canvas_nav_content, | |
#pagelet_ticker { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run pony compiller using docker | |
# requires realpath programm - apt-get install realpath | |
path=$(realpath "$@") | |
/usr/bin/docker run --rm -v ${path}:/src/main ponylang/ponyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Every message has 3 ids, MessageId, CorrelationId, CausationId. | |
When you are responding to a message (either a command or an event) | |
you copy the CorrelationId of the message you are responding to to your message. | |
The CausationId of your message is the MessageId of the message you are responding to. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
def root(n): | |
"""Calculate digital root with modulo arithmetic.""" | |
return n % 9 or n and 9 | |
if __name__ == "__main__": | |
for i in range(9): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
type wget >/dev/null 2>&1 || { echo >&2 "I require wget but it's not installed."; exit 1; } | |
type mdless >/dev/null 2>&1 || { echo >&2 "I require mdless but it's not installed. sudo gem install mdless"; exit 1; } | |
TOOL=${1:?Usage: $0 <toolname> [--refresh]} | |
REFRESH=${2:-no} | |
RAW_MD_URL="https://raw.github.com/hazeorid/devhints.io/gh-pages/${TOOL}.md" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
file_put_contents('latest.zip', fopen('https://wordpress.org/latest.zip', 'r')); | |
system('unzip ./latest.zip'); | |
system('rm ./latest.zip'); | |
system('mv wordpress/* .'); | |
system('rmdir wordpress'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Start interactive console on SIGUSR1 signal. | |
run: | |
$ python ./sigusr1_debug.py | |
and in another window | |
$ ps aux|grep sigusr1_debug | |
$ kill -10 [process pid] | |
and in first window you get: | |
. | |
Signal received : entering python shell. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
xhost + | |
docker run \ | |
--rm \ | |
-e DISPLAY=$DISPLAY \ | |
-v /tmp/.X11-unix:/tmp/.X11-unix \ | |
-v $(pwd)/:/data/ \ | |
-ti eferro/freemind /freemind.sh $(id -u) $* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Rebind prefix key | |
unbind C-b | |
set-option -g prefix C-a | |
bind-key C-a send-prefix | |
# Pretty colors | |
# set -g status-bg blue | |
# set -g status-fg white | |
# Bindings |