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 function solves a "make 10" puzzle: | |
| given a string of digits (e.g., "3596"), | |
| it finds all possible arithmetic expressions using those four digits (each used exactly once) | |
| and the operators +, -, *, / that evaluate to 10. | |
| It also considers different placements of parentheses to account for order-of-operations variations. | |
| It's a brute-force solver for the "four numbers to reach 10" number game. | |
| """ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| import gzip | |
| import json | |
| import yaml | |
| from yaml import Dumper, Loader | |
| FILENAME = "./test.yml" | |
| with open(FILENAME) as fo: | |
| tyaml = fo.read() |
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
| Get-ChildItem "$env:LOCALAPPDATA\Temp" -Recurse -Force -ErrorAction SilentlyContinue | | |
| Where-Object { $_.LastWriteTime -lt (Get-Date).AddDays(-7) } |
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
| tools: | |
| # Order is important! | |
| fzf: junegunn/fzf | |
| rg: BurntSushi/ripgrep | |
| jq: jqlang/jq | |
| lazygit: jesseduffield/lazygit | |
| lnav: tstack/lnav | |
| bat: | |
| repo: sharkdp/bat | |
| shell_code: |
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
| Sub AppendMarkdownUTF8(content As String, strFileName As String) | |
| Dim stream As Object | |
| Dim existingContent As String | |
| Dim strFilePath As String | |
| Dim fso As Object | |
| strFilePath = Environ("USERPROFILE") & "\Documents\Obsidian\Daily\" & strFileName | |
| Set fso = CreateObject("Scripting.FileSystemObject") | |
| ' Create empty file if missing (faster & simpler than ADODB) | |
| If Not fso.FileExists(strFilePath) Then |
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
| # /// script | |
| # requires-python = ">=3.12" | |
| # dependencies = [ | |
| # "requests", | |
| # ] | |
| # /// | |
| import argparse | |
| import csv | |
| import shutil |
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
| Sub SmartArchive() | |
| Dim objApp As Outlook.Application | |
| Dim objSelection As Outlook.Selection | |
| Dim objMail As Outlook.MailItem | |
| Dim objConversation As Outlook.Conversation | |
| Dim objRootItems As Outlook.SimpleItems | |
| Dim objChildItems As Outlook.SimpleItems | |
| Dim objRootItem As Object | |
| Dim objChildItem As Object | |
| Dim objFolder As Outlook.folder |
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
| Sub CloneCalendarItem() | |
| Dim objApp As Outlook.Application | |
| Dim objSelection As Outlook.Selection | |
| Dim objItem As Object | |
| Dim objNewItem As Outlook.AppointmentItem | |
| Dim recip As Outlook.Recipient | |
| Dim newRecip As Outlook.Recipient | |
| Set objApp = Outlook.Application | |
| Set objSelection = objApp.ActiveExplorer.Selection |
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
| import math | |
| PRECISION = 24 * 60 | |
| def average_time(times: list[str]) -> str: | |
| sum_sin = 0.0 | |
| sum_cos = 0.0 | |
| for time_str in times: | |
| hours, mins = map(int, time_str.split(':')) | |
| total_mins = (hours % 24) * 60 + mins |
NewerOlder