Skip to content

Instantly share code, notes, and snippets.

@thierrymoudiki
thierrymoudiki / Makefile
Last active January 14, 2025 08:33
R package workflow (assuming you're on macOS or Linux). You can chain commands `make check&&make install`. See also https://thierrymoudiki.github.io/blog/2024/08/30/r/makefile-r-pkg2.
.PHONY: build buildsite check clean cleanvars coverage docs getwd initialize install installcranpkg installgithubpkg installedpkgs load removepkg render setwd start test usegit
.DEFAULT_GOAL := help
# The directory where R files are stored
R_DIR = ./R
define BROWSER_PYSCRIPT
import os, webbrowser, sys
from urllib.request import pathname2url
@zadjii-msft
zadjii-msft / README.md
Last active June 15, 2025 13:26
Warp Workflows for the Windows Terminal

Add all the Warp Workflows to Windows Terminal

With a combination of features all available in Windows Terminal 1.22, you can now add all your favorite Warp Workflows directly to the Windows Terminal.

image image

This works by adding the workflows to your settings via a "settings fragment". You can then open a menu with all these workflows with the openSuggestions action.

@jimbrig
jimbrig / chrome_flags.updated.js
Created August 15, 2024 19:59 — forked from kkeybbs/chrome_flags.updated.js
Backup chrome flags to json and restore the backup on another machine.
// 2022-04-03, tested with Chrome 99.0.4844.84 on MacBook Pro m1
/*
Open chrome://flags/
F12 open developer console, swtich to tab "Console"
Paste below codes
- input backup() to download flags backup file
- input restore() to select one backup to restore
*/
function saveFile(filename, data) {
@jtrive84
jtrive84 / bsTheme.R
Created August 14, 2024 18:53
Function to change shiny bootstrap theme
sfThemeSelector = function() {
# --------------------------------------------------------------------------
# Allow dynamic update of bootstrap theme.
# --------------------------------------------------------------------------
div(
div(
selectInput(
"shinytheme-selector", "Select theme:",
c("default", shinythemes:::allThemes()),
@StartAutomating
StartAutomating / NotOnAFriday.ps1
Created July 27, 2024 00:36
Gist a little friendly advice about Shipping Software
<#
.Synopsis
Not On a Friday.
.Description
Gist a little bit of friendly advice about the wisdom of shipping software on a Friday.
.Notes
Yes, this runs.
#>
[ValidateScript({
if ([DateTime]::Now.DayOfWeek -eq 'Friday') {
@daveebbelaar
daveebbelaar / document_intelligence.py
Created July 13, 2024 07:08
A service class for interacting with Azure Document Intelligence API.
import logging
import requests
import time
from typing import Union, Dict
from config.settings import get_settings
class DocumentIntelligenceService:
"""
A service class for interacting with Azure Document Intelligence API.
@disler
disler / README.md
Created March 31, 2024 14:34
Use these Prompt Chains to build HIGH QUALITY AI Agents (Agentic Building Blocks)

Setup

  1. Create a new directory with these three files (requirements.txt, main.py, README.md)
  2. python -m venv venv
  3. source venv/bin/activate
  4. pip install -r requirements.txt
  5. python main.py
  6. Update main() to run the example prompt chains
@Konfekt
Konfekt / chatgpt-write-msg.py
Last active May 4, 2024 00:02
let ChatGPT write a sensible commit message using an adaptable Python script
#!/usr/bin/env python3
# Adaption of https://github.com/tom-doerr/chatgpt_commit_message_hook/main/prepare-commit-msg
#
# Mark this file as executable and add it into the global hooks folder
# whose path is given by the core.hooksPath configuration variable
# skip during rebase
import sys
if len(sys.argv) > 2:
@jdhitsolutions
jdhitsolutions / Get-GHIssueStats.ps1
Created March 7, 2024 17:59
My solution for the PowerShell Podcast scripting challenge to write PowerShell code to get GitHub issue statistics.
#requires -version 7.4
<#
This function requires the gh.exe command line tool.
You many encounter API rate restrictions under heavy use.
#>
#load the custom formatting file
Update-FormatData $PSScriptRoot\ghLabelStatus.format.ps1xml
import asyncpg
import dlt
import asyncio
from typing import Any, Dict, Optional
from dlt.common.schema.typing import TColumnSchema
"""Convert an asyncpg type to a dlt column schema type.
This maps asyncpg types to dlt types based on PostgreSQL to Python type mapping
provided by asyncpg and the dlt data types.