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
# 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 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 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 Linux or macOS | |
export CC="zig cc -target x86_64-windows-gnu" | |
export CXX="zig c++ -target x86_64-windows-gnu" | |
./configure --host x86_64-windows-gnu | |
make |
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
"Linux: curl -fLo ~/.vim/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
"PowerShell: iwr -useb https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim |` ni $HOME/vimfiles/autoload/plug.vim -Force | |
let g:pymode_python = 'python3' | |
let g:python3_host_prog = expand('C:\Users\mkeranen\Python\Python310\python.exe') | |
call plug#begin() | |
Plug 'mattn/vim-gist' | |
Plug 'mattn/webapi-vim' |
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
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 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
# brew install unixodbc | |
export CPPFLAGS="-I/opt/homebrew/Cellar/unixodbc/2.3.9_1/include" | |
export LDFLAGS="-L/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib -liodbc -liodbcinst" | |
export PKG_CONFIG_PATH="/opt/homebrew/Cellar/unixodbc/2.3.9_1/lib/pkgconfig $PKG_CONFIG_PATH" | |
pip install --no-binary pyodbc pyodbc |
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
# ========= 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 |
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
# Based on https://gist.github.com/kmatt/71603170556ef8ffd14984af77ff10c5 | |
# prompt ">" indicates Powershell commands | |
# prompt "$" are Linux shell commands | |
# https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
# install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi |
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
" Maintainer: Lars Nielsen (dengmao@gmail.com) | |
" Last Change: January 22 2007 | |
" https://dengmao.wordpress.com/2007/01/22/vim-color-scheme-wombat/ | |
set background=dark | |
hi clear | |
if exists("syntax_on") | |
syntax reset |
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 https://fedoramagazine.org/wsl-fedora-33/ | |
# prompt ">" indicates Powershell commands | |
# https://docs.microsoft.com/en-us/windows/wsl/install-win10 | |
> dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart | |
> dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart | |
# install https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi | |
> wsl --set-default-version 2 |