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
redis: | |
image: redis | |
web: | |
build: . | |
environment: | |
# Points to docker hostname redis (from servicename above) | |
REDIS_URL: "redis://redis/0" |
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
// in top of view file | |
@using Umbraco.Core; | |
@using Umbraco.Core.Models; | |
@using Umbraco.Core.Models.Membership; | |
@using Umbraco.Core.Services; | |
@using Umbraco.Web.Security.Providers; | |
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
location / { | |
... | |
# Disable fbclid tracking on all urls | |
if ($query_string ~ "^(.*)fbclid=(.*)$") { | |
rewrite ^(.*)$ $uri? permanent; | |
} | |
} |
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
# coding: utf-8 | |
def kk(ssn9): | |
""" | |
Calculates control decimals for norwegian national identity numbers | |
see: https://no.wikipedia.org/wiki/F%C3%B8dselsnummer#Oppbygning | |
D nummer: https://no.wikipedia.org/wiki/F%C3%B8dselsnummer#D-nummer | |
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 os | |
def env(key, default=None, return_type=None, list_element_type=str): | |
""" | |
Function to parse settings from environment consistently. | |
Handles parsing of bool/int/list/str values correctly. | |
:param key: name of environment variable to load setting from. | |
:param default: Optional default value if key is not present in environment. # noqa |
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
from datetime import datetime | |
inn = '2019-02-02T23:12:39.05Z' | |
fmt = "%Y-%m-%dT%H:%M:%S.%fZ" | |
print(datetime.strptime(inn, fmt)) |
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
if DEBUG: | |
EMAIL_HOST = 'localhost' | |
EMAIL_PORT = 1025 | |
EMAIL_HOST_USER = '' | |
EMAIL_HOST_PASSWORD = '' | |
EMAIL_USE_TLS = False | |
DEFAULT_FROM_EMAIL = '[email protected]' |
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
# add this to your bash rc file | |
# It will display the current goto project that is active. | |
# zsh: add this line: | |
# setopt PROMPT_SUBST | |
prompt_goto() { | |
# Check if project command exist | |
if [ -z "$(command -v project)" ]; then | |
return 0 |
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 sys | |
default = sys.getdefaultencoding() | |
e_in = sys.stdin.encoding | |
e_out = sys.stdout.encoding | |
print(''' | |
python system default encoding: {} | |
stdin: {} | |
stdout: {} | |
'''.format(default, e_in, e_out) |
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
# add to .bash_profile / .bashrc / .zshrc | |
function backupgoto { | |
foldername=$(date +%d%m%y) | |
target="${HOME}/gotobackup/${foldername}" | |
mkdir -p "$target" | |
cp -r ${HOME}/.goto "$target" \ | |
&& echo "Backuped goto to $target" \ | |
|| echo "Failed to backup goto" | |
} |
NewerOlder