Skip to content

Instantly share code, notes, and snippets.

View timabell's full-sized avatar
🍵
418 I'm a teapot

Tim Abell timabell

🍵
418 I'm a teapot
View GitHub Profile
inoremap <silent> <Bar> <Bar><Esc>:call <SID>align()<CR>a
function! s:align()
let p = '^\s*|\s.*\s|\s*$'
if exists(':Tabularize') && getline('.') =~# '^\s*|' && (getline(line('.')-1) =~# p || getline(line('.')+1) =~# p)
let column = strlen(substitute(getline('.')[0:col('.')],'[^|]','','g'))
let position = strlen(matchstr(getline('.')[0:col('.')],'.*|\s*\zs.*'))
Tabularize/|/l1
normal! 0
call search(repeat('[^|]*|',column).'\s\{-\}'.repeat('.',position),'ce',line('.'))
@mbostock
mbostock / .block
Last active March 1, 2024 06:07
The Gist to Clone All Gists
license: gpl-3.0
#!/bin/bash -v
# backing up a vm
cd /media/tim/WD6/
base="/home/tim/VirtualBox VMs"
src=win10-2018
mv $src.tar.lz4 $src.tar.lz4.old
@timabell
timabell / ms_descriptions.sql
Last active December 6, 2023 19:42
sql server description property management
/*
# About
Source: https://gist.github.com/timabell/6fbd85431925b5724d2f
Permanent copy of schema documentation in a format suitable for
easy source control and hand-editing.
This script template was created by Tim Abell, (c) 2015-2018
#!/bin/sh
# Set up Rails app. Run this script immediately after cloning the codebase.
# Exit if any subcommand fails
set -e
# Copy over configs
if ! [ -f .env ]; then
cp .sample.env .env

Notes about tools for measuring and learning about performance.

Tools that can be used

Name + Link Usecase
Google Pagespeed Insights (PSI) Measuring load and render performance, highlighting basic responsive design issues
What does my site cost Measuring how much the payload of a website costs in different countries
Webpagetest Measuring load and render performance, with comprehensive video and waterfall charts, on a choice of devices and connection speeds
Google Lighthouse ("Audits" tab in Chrome Devtools) Measuring load and render performance, and some basic best practice, PWA, and accessibility criteria
@timabell
timabell / extended_attributes.sql
Created October 6, 2016 09:35
source-controllable self-enforcing extended attribute list for sql server
-- Permanent copy of schema extended properties
-- In a format suitable for easy source control and hand-editing.
-- All the properties are prefixed and only those will be added/updated/deleted by this script
-- At the bottom you'll find a commented-out `select` for generating the
-- insert block from an existing schema's extended properties.
@timabell
timabell / git-many
Last active June 21, 2021 16:18
deal with multiple git repositories
#!/bin/bash
# refs http://tim.theenchanter.com/2008/06/garbage-collect-every-git-repository-on.html
# This script hosted at https://gist.github.com/1391205
echo "Searching..."
find -L . -maxdepth 3 -type d -name .git | while read dir;
do
pushd "$dir" > /dev/null
cd ..
@Zonciu
Zonciu / usersecrets.ps1
Last active December 27, 2020 15:10
Manage User Secrets for .NET Core console application
<#
.NOTES
How to use: Open Visual Studio, go to Tools – External Tools to bring up the External Tools dialog, add a new tools menu with the following configuration:
Title: Manage User Secrets (Or whatever you want)
Command: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe (Path to powershell.exe)
Arguments: Path-to-this-script(e.g. D:\VisualStudioTools\usersecrets.ps1)
Initial Directory: $(ProjectDir)
.PARAMETER ProjectFilePath
The csproj file's path, or keep it empty to search *.csproj file in initial directory
@timabell
timabell / boxstarter.ps1
Last active November 6, 2020 18:29
http://boxstarter.org/ script for .net development in a vm - run it by clicking here: https://is.gd/Zt6ziH
# boxstarter script http://boxstarter.org/
# source: https://gist.github.com/timabell/608fb680bfc920f372ac
# originally tested on win7 x64
# wip on win 10
# dotmatrix (windows branch) https://github.com/timabell/dotmatrix/tree/windows
# powershell profile https://gist.github.com/timabell/56254968905f9066ef88c1ae774a53d1
# This is a start of a build of a box I'm using at the moment.
# Fork this to your own gist, then comment/uncomment/add stuff to suit you.