Skip to content

Instantly share code, notes, and snippets.

View asdfgeoff's full-sized avatar

Geoff Ruddock asdfgeoff

View GitHub Profile
@GitMurf
GitMurf / obsidian.live-preview.css.block-ref-inline.css
Last active February 4, 2024 13:31
CSS for inline block references that works for both NEW CM6 Live Preview and also Preview Mode for both CM5 (Legacy) and CM6 (New)
:root {
/* #7159de (similar to Obsidian purple) */
--block-ref-line-color: grey;
--block-ref-line-type: solid;
--block-ref-line-size: 2px;
/* Set to "inherit" for no bg color */
--block-ref-hover-bg-color: #d4d0d026;
}
/*
@bobbydennett
bobbydennett / redshift_performance_tuning.sql
Created July 9, 2016 00:22
Redshift performance tuning-related queries
--------------------
-- Incorrect column encoding
--------------------
SELECT database, schema || '.' || "table" AS "table", encoded, size
FROM svv_table_info
WHERE encoded='N'
ORDER BY 2;
SELECT trim(n.nspname || '.' || c.relname) AS "table",trim(a.attname) AS "column",format_type(a.atttypid, a.atttypmod) AS "type",
@deanishe
deanishe / rename_workflow.py
Last active December 20, 2022 14:05
Rename Alfred workflow folders after their Bundle IDs
#!/usr/bin/python
# encoding: utf-8
#
# rename_workflow
#
# Copyright (c) 2015 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2015-08-02
@jbwhit
jbwhit / post-save-hook.py
Last active September 21, 2023 04:50
Saves Jupyter Notebooks as .py and .html files automatically. Add to the ipython_notebook_config.py file of your associated profile.
import os
from subprocess import check_call
def post_save(model, os_path, contents_manager):
"""post-save hook for converting notebooks to .py and .html files."""
if model['type'] != 'notebook':
return # only do this for notebooks
d, fname = os.path.split(os_path)
check_call(['jupyter', 'nbconvert', '--to', 'script', fname], cwd=d)
check_call(['jupyter', 'nbconvert', '--to', 'html', fname], cwd=d)