Skip to content

Instantly share code, notes, and snippets.

@persep
persep / .tmux.conf
Created December 13, 2022 10:05 — forked from subfuzion/.tmux.conf
My .tmux.conf for tmux 2.1 (with fixes for mouse breakage)
# Inspirations:
# http://mutelight.org/practical-tmux
# http://zanshin.net/2013/09/05/my-tmux-configuration/
# http://files.floriancrouzat.net/dotfiles/.tmux.conf
# http://stackoverflow.com/questions/9628435/tmux-status-bar-configuration
# https://github.com/Lokaltog/powerline
# https://github.com/remiprev/teamocil
# http://superuser.com/questions/74492/whats-the-best-prefix-escape-sequence-for-screen-or-tmux
# http://blog.hawkhost.com/2010/07/02/tmux-%E2%80%93-the-terminal-multiplexer-part-2/
#
@persep
persep / curl.md
Created December 13, 2022 09:50 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@persep
persep / loop-json.sh
Created October 26, 2022 13:44 — forked from IAmStoxe/loop-json.sh
This example shows you how to utilize jq to loop bash script through an array of JSON values.
jsonData='[{"name": "name#1","value": "value#1"},{"name": "name#2","value": "value#2"}]'
for row in $(echo "${jsonData}" | jq -r '.[] | @base64'); do
_jq() {
echo "${row}" | base64 --decode | jq -r "${1}"
}
# OPTIONAL
# Set each property of the row to a variable
name=$(_jq '.name')
value=$(_jq '.value')
# Install and load required packages
install.packages("needs")
library(needs)
needs(tidyverse, magrittr, animation, pdftools, png, scales)
# Function that extracts data from Google Mobility PDFs
process_google_mobility <- function(country_code, start_date, end_date){
# Convert first page of PDF into high-res PNG
pdf_convert(paste0("https://www.gstatic.com/covid19/mobility/",end_date,"_",country_code,"_Mobility_Report_en.pdf"), format = "png", pages = 1, dpi = 300, filenames = "IMG1.png")
HTML
- Semantic HTML
- Event delegation
- Accessibility / ARIA
CSS
- Specificity
- Pseudo-elements
- Pseudo-selectors
- Combinators
@persep
persep / onlinemapsources.xml
Created February 4, 2019 08:50 — forked from emilydohrem1111/onlinemapsources.xml
Google Maps for OruxMaps, copy to PATH_TO_SDCARD/oruxmaps/mapfiles/
<onlinemapsource uid="0">
<name>Google Maps</name>
<url><![CDATA[https://www.google.com/maps/vt/lyrs=m&x={$x}&y={$y}&z={$z}&scale=2]]></url>
<minzoom>0</minzoom>
<maxzoom>19</maxzoom>
<projection>MERCATORESFERICAx512</projection>
<servers>0,1,2,3</servers>
<httpparam name=""></httpparam>
<cacheable>1</cacheable>
<downloadable>1</downloadable>
@persep
persep / ssh_config.md
Created April 3, 2018 11:04 — forked from jiggneshhgohel/ssh_config.md
Windows 10 Linux Subsystem SSH-agent issues
Host github.com-jiggneshhgohel
HostName github.com
User git
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_work_gmail
AddKeysToAgent yes


Host csexperimental.abc.com
@persep
persep / gist:380f37a630991b30c6c2f324504ede5e
Created March 24, 2018 09:37 — forked from elucify/gist:c7ccfee9f13b42f11f81
BASH: set variables for ANSI text color escape sequences
RESTORE=$(echo -en '\033[0m')
RED=$(echo -en '\033[00;31m')
GREEN=$(echo -en '\033[00;32m')
YELLOW=$(echo -en '\033[00;33m')
BLUE=$(echo -en '\033[00;34m')
MAGENTA=$(echo -en '\033[00;35m')
PURPLE=$(echo -en '\033[00;35m')
CYAN=$(echo -en '\033[00;36m')
LIGHTGRAY=$(echo -en '\033[00;37m')
LRED=$(echo -en '\033[01;31m')
@persep
persep / tmux_build_from_source_CentOS.sh
Created March 14, 2018 14:27 — forked from P7h/tmux__CentOS__build_from_source.sh
tmux 2.0 and tmux 2.3 installation steps for Ubuntu. Or build from tmux source v2.5 for Ubuntu and CentOS.
# Steps to build and install tmux from source.
# Takes < 25 seconds on EC2 env [even on a low-end config instance].
VERSION=2.5
sudo yum -y remove tmux
sudo yum -y install wget tar libevent-devel ncurses-devel
wget https://github.com/tmux/tmux/releases/download/${VERSION}/tmux-${VERSION}.tar.gz
tar xzf tmux-${VERSION}.tar.gz
rm -f tmux-${VERSION}.tar.gz
cd tmux-${VERSION}
@persep
persep / tmux-cheatsheet.markdown
Created March 14, 2018 10:26 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname