Instantly share code, notes, and snippets.

View to_gif.sh
#!/bin/bash
inputFile=$1
FPS=15
WIDTH=1200
#Generate palette for better quality
ffmpeg -i $inputFile -vf fps=$FPS,scale=$WIDTH:-1:flags=lanczos,palettegen tmp_palette.png
#Generate gif using palette
View .ideavimrc
""README
"" This file should be called .ideavimrc on a linux/unix system or _ideavimrc on a windows system.
"" You will need to restart intellij once the file is added.
" Makes moving the cursor function as expected with wrapped lines
noremap j gj
noremap k gk
" This will keep the cursor at least 15 lines away from the top or bottom of the editor window
set scrolloff=15
View progress_bar.py
import sys
def drawProgressBar(percent_done, barLength = 40):
"""Display an updating progress bar in a terminal
:percent_done: the percent done to display
:barLength: how many chars long the bar is
:returns: None
View copy_paste.bash.alias
#copies the piped input onto the clipboard
alias copy="xclip -selection c"
#pastes the clipboards contents into the terminal
alias paste="xclip -selection clipboard -o"
View Sierpinsky.py
import math
from turtle import *
size = 800
minimum = 8
pythagoras = math.sqrt(3) / 2
def s(l, x, y):
if l>minimum:
View BtcPrices.sh
echo -n 'Current price of bitcoin in ' ; curl -s https://blockchain.info/ticker | grep USD | tr -s ' ' | tr -d '"' | tr -d ' ' | cut -d ':' -f 1,3 | cut -d ',' -f 1
echo -n 'Current price of bitcoin in ' ; curl -s https://blockchain.info/ticker | grep CAD | tr -s ' ' | tr -d '"' | tr -d ' ' | cut -d ':' -f 1,3 | cut -d ',' -f 1
View reverseScrolling.sh
echo "pointer = 1 2 3 5 4 7 6 8 9 10 11 12" > ~/.Xmodmap && xmodmap ~/.Xmodmap