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
default partial alphanumeric_keys modifier_keys | |
xkb_symbols "pc105" { | |
key <ESC> { [ Escape ] }; | |
// The extra key on many European keyboards: | |
key <LSGT> { [ less, greater, bar, brokenbar ] }; | |
// The following keys are common to all layouts. | |
key <BKSL> { [ backslash, bar ] }; |
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
db: | |
ports: | |
- 5432:5432 | |
entrypoint: | |
- docker-entrypoint.sh | |
- -c | |
- log_statement=all | |
- -c | |
- log_destination=stderr | |
- -c |
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
-- Find views that depend on something | |
select schemaname, viewname, viewowner from pg_views where viewowner != ‘rdsadmin’ and definition ilike ‘%pg_stat_activity%‘; | |
-- show running queries (9.2) | |
SELECT pid, age(clock_timestamp(), query_start), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start ASC; | |
-- kill running query |
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
{ | |
"title": "Change Option + Up / Down to Page Up / Down P", | |
"rules": [ | |
{ | |
"description": "Change Option + Up / Down to Page Up / Down", | |
"manipulators": [ | |
{ | |
"from": { | |
"key_code": "down_arrow", | |
"modifiers": { |
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
on replace_chars(this_text, search_string, replacement_string) | |
set AppleScript's text item delimiters to the search_string | |
set the item_list to every text item of this_text | |
set AppleScript's text item delimiters to the replacement_string | |
set this_text to the item_list as string | |
set AppleScript's text item delimiters to "" | |
return this_text | |
end replace_chars | |
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
def watcher(url, expected_content, expected_status_code, interval, timeout, queue): | |
response = Response(multiprocessing.current_process().name) | |
try: | |
request_response = requests.get(url, timeout=timeout) | |
except requests.exceptions.ReadTimeout: | |
error = Timeout('Open page', 'Timed out after {} seconds'.format(timeout)) | |
response.add_error(error) | |
else: | |
response.set_elapsed_time(request_response.elapsed) |
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
$ ipython profile create | |
$ vim ~/.config/ipython/profile_default/ipython_config.py | |
# Configuration file for ipython. | |
c = get_config() | |
#------------------------------------------------------------------------------ | |
# InteractiveShellApp configuration | |
#------------------------------------------------------------------------------ |
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
proxy_pass http://localhost:5000; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-for $remote_addr; | |
proxy_connect_timeout 300; | |
port_in_redirect off; |
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 ruby | |
# | |
# Runs during git flow hotfix start | |
# | |
# Positional arguments: | |
# $1 Version | |
# | |
# Return VERSION - When VERSION is returned empty, git-flow will stop as the | |
# version is necessary | |
# |
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
import platform | |
try: | |
import winsound | |
beep = winsound.Beep | |
except ImportError: | |
def beep(f, d): | |
s = 8000 | |
hp = int(s/f/2) | |
b = chr(255)*hp+chr(0)*hp |