Skip to content

Instantly share code, notes, and snippets.

@lundeen-bryan
lundeen-bryan / stored_procedure_log_snippet.code-snippets
Created October 23, 2024 19:52
snippet for creating a stored sql procedure
{
"Add Logging to Stored Procedure":{
"prefix": "addlogging",
"body": [
"CREATE PROCEDURE ${1:ProcedureName}",
"AS",
"BEGIN",
" --Log procedure execution",
" INSERT INTO ProcedureUsageLog(ProcedureName, ExecutionTime, DBName)",
" VALUES('$1', GETDATE(), DB_NAME();",
@lundeen-bryan
lundeen-bryan / post_trial_caseloads.sql
Last active October 11, 2024 14:15
sql_merge.sql
WITH CTE_PatientStatus AS (
SELECT
LEFT(RIGHT(CPS.Case_Number, 7), 6) + '-' + RIGHT(CPS.Case_Number, 1) AS Patient_Num,
CPS.Rpt_Legal_Class_Text,
LEG.Legal_Class_Text,
CPS.Status_Text,
CONVERT(VARCHAR(10), ADM.DOB, 101) AS DOB,
CPS.Rpt_LC_Start_Date,
ADM.Admission_Date,
CPS.Rpt_LC_End_Date,
@lundeen-bryan
lundeen-bryan / CTE.html
Created June 19, 2024 18:38
CTE_Notebook_Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>SQL and Markdown Notebook</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
@lundeen-bryan
lundeen-bryan / Boolean_Indexing_Masking_Tutorial.ipynb
Last active March 25, 2024 19:57
Boolean_Indexing_Masking_ChatGPT_Tutorial
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lundeen-bryan
lundeen-bryan / len_home_settings.json
Created March 1, 2024 03:50
len_home_settings.json
{
// use "Settings Sync: Show Synced Data" in the palette.
// https://code.visualstudio.com/docs/getstarted/settings
// Use the compact view of the toolbar
"window.menuBarVisibility": "compact",
"window.zoomLevel": 1,
// Set this file to be machine specific: home machine
"sync.machineSpecific": true,
// Vim settings section
"vim.vimrc.path": "$HOME/.vim/_vimrc",
@lundeen-bryan
lundeen-bryan / tab_config.json
Last active January 9, 2024 15:00
tab_config file
{
"alwaysNewTab": false,
"bgColor": "#1b2b34",
"caretColor": "auto",
"clockSize": "2em",
"defaultCommand": "g",
"fontSize": "1.75em",
"gistID": "",
"militaryClock": false,
"showClock": true,
@lundeen-bryan
lundeen-bryan / Refresh_all_Queries_2023-11-26.html
Last active November 26, 2023 18:32
vba loop to refresh queries
<!DOCTYPE html>
<html lang="en-US" data-theme="dark">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="https://chat.openai.com/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Refresh all Queries</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/github-dark.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js"></script>
<script>

ACRExtensions_bookmarklet_README

The Bookmarklet

Note, it appears to not work anymore, but some of it is documented in the following ccimpoiACRExtensions Amazon Cloud Reader extensions

javascript:(()%3D%3E%7Bfunction%20enhanceKindleContextMenu()%7Bvar%20e%3Dnull%2Cn%3Dnull%2Co%3Dnull%3Bif(void%200!%3D%3Dwindow.KindleReaderContextMenu)e%3Dwindow%3Belse%20if(window.length)for(var%20t%3D0%3Bt%3Cwindow.length%3Bt%2B%2B)if(void%200!%3D%3Dwindow%5Bt%5D.KindleReaderContextMenu)%7Be%3Dwindow%5Bt%5D%3Bbreak%7Dif(%22object%22%3D%3Dtypeof%20e)if(o%3De.KindleReaderContextMenu%2Cn%3De.document%2Cvoid%200%3D%3D%3Do.ACRExtensions)%7Bo.ACRExtensions%3D!0%3Bvar%20i%3Do.show%3Bo.show%3Dfunction()%7Bvar%20e%3Di.apply(o%2Carguments)%2Ct%3Dnull%2Cs%3Dnull%3Bif(void%200!%3D%3Darguments%5B3%5D%26%26void%200!%3D%3Darguments%5B3%5D.start)%7Bvar%20d%3Darguments%5B3%5D.start%2Cr%3Darguments%5B3%5D.end%3B%24(%22iframe%22%2Cn).each((function(e%2Cn)%7Bvar%20o%3D%24(n
@lundeen-bryan
lundeen-bryan / test_notebook.sql
Last active September 17, 2023 21:39
sql_notebook_text
/*markdown
# MySQL vs. MSSQL
Typically in MSSQL we escape keywords by placing them in square brackets, but in MySQL it is not necessary. Sometimes it may cause errors.
*/
SELECT *
FROM `sakila`.`customer`
LIMIT 10
;
@lundeen-bryan
lundeen-bryan / get_dates.js
Last active September 10, 2023 02:28
Show all dates in current webpage in a popup
/**
* Date Extractor from HTML
*
* Version: 1.0.0
*
* Purpose:
* This script is designed to extract dates present in an HTML document.
* It uses multiple regular expressions to detect a variety of date formats.
* After extracting all the unique dates, it presents them in a new popup window,
* sorted in descending order from newest to oldest. If no dates are found,