This file contains hidden or 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
# | |
# This shell prompt config file was created by promptline.vim | |
# | |
function __promptline_host { | |
local only_if_ssh="0" | |
if [ $only_if_ssh -eq 0 -o -n "${SSH_CLIENT}" ]; then | |
if [[ -n ${ZSH_VERSION-} ]]; then print %m; elif [[ -n ${FISH_VERSION-} ]]; then hostname -s; else printf "%s" \\h; fi | |
fi | |
} |
This file contains hidden or 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 pl_to_sql(df, table, replace=False): | |
""" | |
to_sql() without Pandas | |
Appends or overwrites a SQL Server table using data from a DataFrame | |
Parameters: | |
df (DataFrame): df used to create/append table | |
table (str): Name of existing SQL Server table | |
replace (bool): Truncate before insert | |
Returns: |
This file contains hidden or 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
[cmdletbinding()] | |
Param( | |
[Parameter(Mandatory=$true)] | |
[string[]]$servers, | |
[ValidateScript({ | |
if(-Not ($_ | Test-Path )) { | |
throw "Folder does not exist" | |
} | |
return $true |
These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.
- 🔴 Mandatory (for both beginners and intermediates)
- 🟩 For beginners
- 🟨 For intermediates
This file contains hidden or 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
# Alternative to_sql() *method* for mssql+pyodbc or mssql+pymssql | |
# | |
# adapted from https://pandas.pydata.org/docs/user_guide/io.html#io-sql-method | |
import json | |
import pandas as pd | |
import sqlalchemy as sa | |
def mssql_insert_json(table, conn, keys, data_iter): |
This file contains hidden or 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
# version 1.2 - 2022-11-01 | |
import pandas as pd | |
import sqlalchemy as sa | |
def df_upsert(data_frame, table_name, engine, schema=None, match_columns=None): | |
""" | |
Perform an "upsert" on a SQL Server table from a DataFrame. | |
Constructs a T-SQL MERGE statement, uploads the DataFrame to a |
This file contains hidden or 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
Create a file: | |
$ vim /Users/Shared/logoutHook.sh | |
File content: | |
#!/bin/bash | |
say 'Hasta la vista baby!' | |
Set execution permission: | |
$ sudo chmod +x /Users/Shared/logoutHook.sh |
This file contains hidden or 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
# ========= PROMPT ========= | |
# Version control information | |
autoload -Uz vcs_info | |
precmd() { vcs_info } | |
# Format the vcs_info_msg_0_ variable | |
zstyle ':vcs_info:git:*' formats ' %b ' | |
# Render the prompt | |
setopt PROMPT_SUBST |
NewerOlder