See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
| # Upsert function for pandas to_sql with postgres | |
| # https://stackoverflow.com/questions/1109061/insert-on-duplicate-update-in-postgresql/8702291#8702291 | |
| # https://www.postgresql.org/docs/devel/sql-insert.html#SQL-ON-CONFLICT | |
| import pandas as pd | |
| import sqlalchemy | |
| import uuid | |
| import os | |
| def upsert_df(df: pd.DataFrame, table_name: str, engine: sqlalchemy.engine.Engine): |
| import json | |
| with open('filename.json', 'r') as f: | |
| json_dict = json.load(f) | |
| for key in json_dict: | |
| print(key['attribute']) |
| #!/bin/bash | |
| SUDO='' | |
| if (( $EUID != 0 )); then SUDO='sudo'; fi | |
| echo "Basic auth for traefik >= v1.7" | |
| read -p "User: " USER | |
| read -p "Password: " PW | |
| # Checks if htpasswd is available or install it otherwise |
See how a minor change to your commit message style can make a difference.
git commit -m"<type>(<optional scope>): <description>" \ -m"<optional body>" \ -m"<optional footer>"
| import genanki | |
| my_model = genanki.Model( | |
| 1380120064, | |
| 'Example', | |
| fields=[ | |
| {'name': 'Object'}, | |
| {'name': 'Image'}, | |
| ], | |
| templates=[ |
Here are the steps to installing and setting up GDB on Mac OS Sierra/High Sierra.
Run brew install gdb.
On starting gdb, you will get the following error:
Unable to find Mach task port for process-id 2133: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))To fix this error, follow the following steps:
| version: '3' | |
| services: | |
| nginx-proxy: | |
| image: jwilder/nginx-proxy | |
| labels: | |
| com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy: "true" | |
| container_name: nginx-proxy | |
| restart: unless-stopped | |
| ports: |
| --- | |
| - hosts: all | |
| become: yes | |
| tasks: | |
| - name: set timezone to Europe/London | |
| timezone: | |
| name: Europe/London |
| git describe --exact-match --tags 2> /dev/null || git rev-parse --short HEAD |
| # this original one uses values returned from 'brew info' | |
| brew list --formula | xargs -n1 -P8 -I {} \ | |
| sh -c "brew info {} | egrep '[0-9]* files, ' | sed 's/^.*[0-9]* files, \(.*\)).*$/{} \1/'" | \ | |
| sort -h -r -k2 - | column -t | |
| # faster alternative using 'du' | |
| du -sch $(brew --cellar)/*/* | sed "s|$(brew --cellar)/\([^/]*\)/.*|\1|" | sort -k1h |