Skip to content

Instantly share code, notes, and snippets.

@lundeen-bryan
lundeen-bryan / get_query_data.py
Last active March 31, 2024 06:11
sync with a SharePoint list to xl
# %%
import xlwings as xw
# Define the path to your .iqy file
iqy_file_path = 'query.iqy'
# Initialize variables to hold the data you're interested in
sharepoint_application_url = ''
list_view_id = ''
list_name_id = ''
@lundeen-bryan
lundeen-bryan / keybindings.json
Last active November 23, 2023 18:46
vscode_settings_nsh
// This keybindings file needs to go in the user folder
// under appdata>code>user
[
{
"key": "ctrl+k tab",
"command": "type",
"args": { "text": "\t" },
"when": "editorTextFocus"
},
{
@lundeen-bryan
lundeen-bryan / classes.yaml
Last active January 15, 2024 05:04
index of Udemy courses
# CLASSES TO TAKE IN ORDER
- title: "Learn SQL in a Day: ChatGPT Enhanced Crash Course"
description: "A modern day, ChatGPT assisted approach to learning SQL in an optimal manner including how to learn with ChatGPT"
length: "2h 6m"
sales_url: "https://www.udemy.com/course/learn-sql-in-a-day-chatgpt-enhanced-crash-course/"
course_url: "https://www.udemy.com/course/learn-sql-in-a-day-chatgpt-enhanced-crash-course/learn/"
instructor_name: "Joshua Beauchamp"
instructor_courses: "https://www.udemy.com/home/my-courses/learning/?instructor_filter=225463566"
@lundeen-bryan
lundeen-bryan / return_last_row.md
Last active March 18, 2023 23:56
vba snippets

Option Explicit

'used to get last row of a column Function last_row_in_column(column_letter As String) As String Dim data_in_column As Range, result As Long Set data_in_column = Range(column_letter & "1:" & _ column_letter & _ Cells(Rows.Count, column_letter).End(xlUp).Row) Let result = data_in_column.Find("*", , xlValues, , xlByRows, xlPrevious).Row Let last_row_in_column = result

@lundeen-bryan
lundeen-bryan / last_refreshed.bas
Last active July 13, 2022 16:35
how to make a count of last refreshed in powerquery
Start with the power query below:
let
Source = SourceData,
//the source needs to be a table that is in powerquery
#"Counted Rows" = Table.RowCount(Source),
#"Converted to Table" = #table(1, {{#"Counted Rows"}}),
#"Renamed Columns" = Table.RenameColumns(#"Converted to Table",{{"Column1", "Total_records"}}),
#"Added Custom" = Table.AddColumn(#"Renamed Columns", "Last_Refresh", each DateTime.LocalNow()),
#"Added Custom1" = Table.AddColumn(#"Added Custom", "Date", each DateTime.Date([Last_Refresh])),
@lundeen-bryan
lundeen-bryan / udemy.css
Last active June 27, 2023 19:35
browser_css
/* use for udemy notifications */
.activity-notifications-module--notification-list--3I_hF {
width:1200px
}
.activity-notification-module--notification-info--3Yr2y {
height: 170px;
}
/* create CRLF after title then, normal font for the body text */
span[data-purpose="safely-set-inner-html:activity-notification:notification-template"] span.subject::before {
content: "\A";
@lundeen-bryan
lundeen-bryan / _clear_console.py
Last active March 31, 2023 02:15
python snippets
import os
#from os import system
#HINT: You can call clear() to clear the output in the console.
def clear():
os.system("clear")
# test code to put something on the screen: print("A bunch of stuff")
""" test code to call the function
clear_now = input("Do you want to clear the output? (y/n): ")
if clear_now == "y":
@lundeen-bryan
lundeen-bryan / file_control.py
Created November 3, 2022 02:08
file read write util
import os
from os import path, sys
def read_file(file_name):
file_name = os.path.join(sys.path[0], file_name)
if path.isfile(file_name):
with open(file_name, mode="r") as file:
contents = file.readlines()
return contents
else:
@lundeen-bryan
lundeen-bryan / .bash_aliases
Last active September 15, 2023 13:24
bash_backups
# list files per line
alias lf="ls -1ASk"
# quit bash like in vim
alias :q="exit"
# clear the screen
alias clr="clear"
# run ipython with vi
alias ipy="ipython --TerminalInteractiveShell.editing_mode='vi'"
# show grep history
alias gh="history|grep"
@lundeen-bryan
lundeen-bryan / bar_chart_exercise.ipynb
Last active January 22, 2023 18:25
bar_chart_exercise.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.