This file contains hidden or 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 push-graph='rsync -avm --delete --progress ~/<LOCAL_DIR>/* <USER>@<SERVER_IP_ADDRESS>:/var/www/html/' |
This file contains hidden or 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
| import time | |
| import numpy as np | |
| def timer(f, param): | |
| start = time.time() | |
| r = False | |
| for i in range(1000): | |
| r = f(param) | |
| return (time.time() - start) / 1000 if r is not False else -1 |
This file contains hidden or 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
| xterm*reverveVideo: false | |
| xterm*selectToClipboard: true | |
| xterm*saveLines: 4096 | |
| xterm*faceName: BitstreamVeraSansMono Nerd Font | |
| xterm*faceSize: 11 | |
| xterm*vt100*geometry: 80x30 | |
| xterm*termName: xterm-color | |
| xterm*eightBitInput: false | |
| xterm*VT100.Translations: #override \ |
This file contains hidden or 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
| set nocompatible | |
| filetype off " required | |
| syntax enable | |
| set rtp+=~/.vim/bundle/Vundle.vim | |
| call vundle#begin() | |
This file contains hidden or 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
| ffmpeg -f image2 -i image-%03d.png -s 640x360 -vcodec libx264 -preset slow -crf 18 -b:v 3000k -maxrate 4000k -bufsize 512k -c:a aac -b:a 128k -strict -2 weave-1.mp4 |
This file contains hidden or 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 pngToGif() { | |
| while getopts ":i:o:" opt; do | |
| case $opt in | |
| i) input_file="${OPTARG}" | |
| ;; | |
| o) output_file="${OPTARG}" | |
| ;; | |
| \?) echo "Invalid option -${OPTARG}" >&2 | |
| ;; | |
| esac |
This file contains hidden or 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
| ffmpeg -f x11grab -y -r 30 -s 1920x1080 -i :0.0 -vcodec huffyuv out.avi | |
| # Then convert it to .mp4 | |
| ffmpeg -y -i out.avi -s 1920x1080 -f mp4 -vcodec libx264 -preset slow -crf 18 -b:v 3000k -maxrate 4000k -bufsize 512k -c:a aac -b:a 128k -strict -2 out.mp4 | |
| # and remove the .avi | |
| rm out.avi |
This file contains hidden or 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
| const camelCaseToDelimitedString = (string, delimiter = '-') => | |
| string.replace(/([a-z0-9]|(?<!^)(?=[A-Z]))([A-Z])/g, '$1'+delimiter+'$2').toLowerCase(); | |
| const delimitedStringToCamelCase = (string, delimiter = '-') => | |
| string.replace(new RegExp(delimiter + '([a-z])', 'g'), (m, c) => c.toUpperCase()); |
This file contains hidden or 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
| const combineObjectArrays = (p: any[], q: any[], key = 'id') => { | |
| const storedIds: any = []; | |
| const arr: any = []; | |
| for (let i = 0; i < Math.max(p.length, q.length); i++) { | |
| if (i < p.length && !storedIds.includes(p[i][key])) { | |
| storedIds.push(p[i][key]); | |
| arr.push(p[i]); | |
| } | |
| if (i < q.length && !storedIds.includes(q[i][key])) { | |
| storedIds.push(q[i][key]); |
This file contains hidden or 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 | |
| brew unlink vim | |
| brew install cmake macvim | |
| git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim; | |
| touch .vimrc; | |
| cat << EOF > .vimrc | |
| set nocompatible |