Skip to content

Instantly share code, notes, and snippets.

@LukasMFR
LukasMFR / chatgpt-conversation-exporter.js
Created December 12, 2025 12:36
JavaScript snippet to export a ChatGPT conversation from the web UI to a clean Markdown file, with correct user/assistant attribution, code block preservation, and basic media placeholders. Designed to be run directly in the browser console (Safari/Chrome/Firefox).
(() => {
function formatDate(date = new Date()) {
return date.toISOString().split("T")[0];
}
function escapeMarkdown(text) {
return text
.replace(/\\/g, "\\\\")
.replace(/\*/g, "\\*")
.replace(/_/g, "\\_")
@FeralFlora
FeralFlora / 01 Zotero Integration import template and more!.md
Last active February 23, 2026 19:22
Zotero import template for the Zotero integration plugin for Obsidian. Screenshots and usage guide over in the Obsidian forum here: https://forum.obsidian.md/t/zotero-integration-import-templates/36310/105?u=feralflora
  • ZI-main.md
    • The main Zotero Integration template
  • runImport.md
    • Template that enables updating literature notes at the click of a button, and much more.
  • Meta bind button template
    • Template for in-note button that executes runImport.md
@astraetech
astraetech / discretionary accruals.sas
Created April 22, 2023 00:44 — forked from mgao6767/discretionary accruals.sas
Compute 5 measures of firm-year discretionary accruals.
/* Use Jackknife method to compute discretionary accruals */
/* see https://mingze-gao.com/posts/compute-jackknife-coefficient-estimates-in-sas/ */
/* UseHribarCollinsTotalAccruals:
- true: use Hribar-Collins Cashflow Total Accruals
- false: use normal method */
%let UseHribarCollinsTotalAccruals = false;
/* Include %array and %do_over */
filename do_over url "https://mingze-gao.com/utils/do_over.sas";
@bpsib
bpsib / BBC-Radio-HLS.m3u
Last active April 8, 2026 15:10 — forked from stengland/BBC-Radio.m3u
BBC Radio Streams
#EXTM3U
#EXTINF:-1,BBC - Radio 1
http://as-hls-ww-live.akamaized.net/pool_01505109/live/ww/bbc_radio_one/bbc_radio_one.isml/bbc_radio_one-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Xtra
http://as-hls-ww-live.akamaized.net/pool_92079267/live/ww/bbc_1xtra/bbc_1xtra.isml/bbc_1xtra-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1Dance
http://as-hls-ww-live.akamaized.net/pool_62063831/live/ww/bbc_radio_one_dance/bbc_radio_one_dance.isml/bbc_radio_one_dance-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 1 Anthems (UK Only)
http://as-hls-uk-live.akamaized.net/pool_11351741/live/uk/bbc_radio_one_anthems/bbc_radio_one_anthems.isml/bbc_radio_one_anthems-audio%3d96000.norewind.m3u8
#EXTINF:-1,BBC - Radio 2
@iangow
iangow / winsor.md
Last active October 15, 2020 20:04
Winsorizing in R to match SAS

Here is a SAS macro for winsorizing data that seems to be commonly used in accounting and finance research. This code comes from replication materials provided by Fang, Huang and Karpoff ("FHK") here. Below I provide an R function that produces equivalent results.

%MACRO winsorize(var, var_out, by_var, left, right, input, output);
	%LET var_number = 1; 
	%LET var&var_number = %QSCAN(&var, &var_number, %STR( ));
	%DO %WHILE (&&var&var_number NE);
		%LET var_number = %EVAL(&var_number + 1);