Skip to content

Instantly share code, notes, and snippets.

@iamjasonaevans
iamjasonaevans / Video - YouTube.md.txt
Created January 26, 2024 08:49 — forked from ScottJWalter/Video - YouTube.md.txt
obsidian youtube templater
<%"---"%>
created: <% tp.file.creation_date('YYYY-MM-DD HH:MM:ssSS') %>
updated: <% tp.file.creation_date('YYYY-MM-DD HH:MM:ssSS') %>
cloud_host: "pcloud"
tags:
- video
- youtube
<%*
/*
REMEMBER: Save this file as 'Video - YouTube.md' (strip the '.txt' extension)
@iamjasonaevans
iamjasonaevans / keybindings.json
Created January 8, 2024 08:11 — forked from ixahmedxi/keybindings.json
Vscode neovim keybindings.json
[
{
"command": "vscode-neovim.compositeEscape1",
"key": "j",
"when": "neovim.mode == insert && editorTextFocus",
"args": "j"
},
{
"command": "vscode-neovim.compositeEscape2",
"key": "k",
@iamjasonaevans
iamjasonaevans / tmux_colors.sh
Last active March 23, 2018 05:57
List tmux colors
#!/bin/sh
for i in {0..255}; do
printf "\x1b[38;5;${i}mcolour${i}\x1b[0m\n"
done
@iamjasonaevans
iamjasonaevans / pre-commit
Last active March 23, 2018 05:59
Git Pre Commit Hooks
#!/bin/sh
FILES='(js|css|rb|slim|haml|jsx)'
FORBIDDEN='(binding.pry|console.log|\!important|binding.pry_remote)'
GREP_COLOR='4;5;37;41'
if [[ $(git diff --cached --name-only | grep -E $FILES) ]]; then
git diff --cached --name-only | grep -E $FILES | \
xargs grep --color --with-filename -n -E $FORBIDDEN && \
echo "Looks like you are trying to commit something you shouldn't. Please fix your diff, or run 'git commit --no-verify' to skip this check, if you must." && \
exit 1
let i = 1
while i <= 9
execute 'nnoremap <Leader>' . i . ' :' . i . 'wincmd w<CR>'
let i = i + 1
endwhile
@iamjasonaevans
iamjasonaevans / size_of_tables.sql
Created August 1, 2016 22:27
Get the size of all tables in a database in mysql
SELECT TABLE_NAME AS "Table Name",
table_rows AS "Quant of Rows", ROUND( (
data_length + index_length
) /1024, 2 ) AS "Total Size Kb"
FROM information_schema.TABLES
WHERE information_schema.TABLES.table_schema = '<DATABASENAME>'
LIMIT 0 , 30
@iamjasonaevans
iamjasonaevans / size_of_all_tables.sql
Created August 1, 2016 22:25
Get the size of all tables in a mysql server
SELECT
table_schema as `Database`,
table_name AS `Table`,
round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
FROM information_schema.TABLES
ORDER BY (data_length + index_length) DESC;
@iamjasonaevans
iamjasonaevans / gist:639f533931c0dcf2ad17
Last active August 29, 2015 14:19
Simple Web Server
# Simple Ruby server
ruby -run -e httpd -- -p 5000 .
# Simple Python Server
python -m SimpleHTTPServer 5000
# alias entries
alias start-webserver-python='python -m SimpleHTTPServer 8000'
alias start-webserver-ruby='ruby -run -e httpd . -p 5000'