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
#!/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
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
#!/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
-- 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
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Simple json server. | |
echo '{"data": "some"}' > p1.json | |
python -m jsonserver | |
curl http://localhost:8000/p1 | |
""" |
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 python3 | |
# -*- coding: utf-8 -*- | |
from collections import namedtuple | |
import requests | |
import logging | |
import json | |
import enum | |
class ApiInteraction(enum.Enum): |
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
class Specification: | |
def __and__(self, other): | |
return And(self, other) | |
def __or__(self, other): | |
return Or(self, other) | |
def __xor__(self, other): | |
return Xor(self, other) |
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: [URL …or… mobile OS + app] | |
STEPS: | |
1. [list the exact steps it takes to reproduce the problem] | |
2. [use numbers to show each step in order] | |
3. [include multiple apps if necessary] | |
4. [write it so a 10 year old could reproduce] | |
ACTUAL: [identify the thing that is broken, screenshots help] | |
EXPECTED: [explain what you expected to see] | |
URGENCY: [only for critical production issue reports] | |
Example: |