This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to show the first X commits | |
function git-first { | |
git log --format="%H" | tac | head -n $1 | xargs git log -p | |
} | |
# Function to show the last X commits | |
function git-last { | |
git log -p -n $1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Brown noise | |
ffmpeg.ffplay -f lavfi -showmode 0 -i 'anoisesrc=color=brown' | |
# White Noise | |
ffmpeg.ffplay -f lavfi -showmode 0 -i 'anoisesrc=color=white' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Album limit | |
ALBUM_LIMIT=10 | |
# Get latest library from cmus | |
cmus-remote -C "save -l $(pwd)/cmus-library.pl" | |
# Use awk to group songs by album | |
awk -F'/' '{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% comment %} TODO this should likely be resolved by proper layout usage (dedicated paginator page layout for starters) {% endcomment %} | |
{% assign meta_desc = site.description %} | |
{% unless page.url == '/' %} | |
{% if page.meta_description %} | |
{% capture meta_desc %}{{ page.meta_description }}{% endcapture %} | |
{% elsif page.excerpt %} | |
{% capture meta_desc %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% endcapture %} | |
{% elsif page.content %} | |
{% if page.content contains "for post in paginator.posts" %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# encoding: utf-8 | |
# | |
# Jekyll category page generator. | |
# http://recursive-design.com/projects/jekyll-plugins/ | |
# | |
# Version: 0.2.4 (201210160037) | |
# | |
# Copyright (c) 2010 Dave Perrett, http://recursive-design.com/ | |
# Licensed under the MIT license (http://www.opensource.org/licenses/mit-license.php) | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add these to your browser as bookmarks: | |
// Filter commentless files | |
javascript:document.querySelectorAll('#files%20>%20div%20>%20div').forEach((e)%20=>%20{%20if%20(e.querySelectorAll('[data-disable-with="Resolving%20conversation%E2%80%A6"]').length%20===%200)%20{%20e.style.display%20=%20'none';%20}%20%20}) | |
// Filter viewed files | |
javascript:document.querySelectorAll('#files%20input[name="viewed"][data-ga-click$="value:true"]').forEach(e=>{e.closest(".file").style.display="none"}); | |
// Fold All (a bit slow) | |
javascript:document.querySelectorAll('.file-info > button[aria-expanded="true"]:nth-child(1)').forEach((e) => { e.click() }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alias for local.run (locally served content), defaults to localhost:80 | |
function locrun { | |
INPUT_HOST=$1 | |
if [ -z "$1" ]; | |
then INPUT_HOST="localhost:80" | |
else INPUT_HOST=$1 | |
fi | |
ssh -R 80:$INPUT_HOST nokey@localhost.run | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Alias to compress pdf | |
function pdfcomp { | |
INPUT_FILE=$1 | |
FILE_EXTENSION="${INPUT_FILE##*.}" | |
FILE_NAME="${INPUT_FILE%.*}" | |
OUTPUT_FILE="$FILE_NAME-compressed.$FILE_EXTENSION" | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=$OUTPUT_FILE $INPUT_FILE | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for file in "$@"; do | |
echo "$file" | |
ffmpeg -i $file -af atempo=1.5 faster_$file | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"Console_Log_File": { | |
"prefix": "clg", | |
"body": [ | |
"console.log('${TM_FILENAME}#${TM_LINE_NUMBER}: ', ${1:var});" | |
] | |
} | |
//expands clg to console.log('filename.js#line-number: , VAR); |
NewerOlder