Skip to content

Instantly share code, notes, and snippets.

View voyeg3r's full-sized avatar

Sérgio Luiz Araújo Silva voyeg3r

View GitHub Profile
@s1n7ax
s1n7ax / init.lua
Created May 22, 2022 09:44
Show file path in the winbar
vim.o.winbar = "%{%v:lua.require'nvim.utils.nvim.winbar'.eval()%}"
@cookiengineer
cookiengineer / apt-pac.sh
Last active September 11, 2023 20:06
APT-PAC - pacman with APT syntax
#!/bin/bash
# Save this file as /usr/bin/apt-pac and chmod +x it.
case "$1" in
autoremove)
pacman -Rns $(pacman -Qdtq);
;;
@nv1t
nv1t / slideshare-download.sh
Last active September 10, 2015 01:20
slideshare-download.sh
#!/bin/bash
URL="${1}"
TITLE=$(echo $URL | awk -F"/" '{ print $NF }' | awk -F"?" '{ print $1 }')
mkdir -p "${TITLE}"
cd "${TITLE}"
for i in $(curl "${URL}" 2> /dev/null | grep "slide_image" | tr '"' "\n" | grep -A 1 "data-full" | grep "image.slidesharecdn"); do
@welldan97
welldan97 / system-wide-clipboard.zsh
Created March 10, 2013 09:51
Zsh copy & paste system wide for OS X, like in emacs
pb-kill-line () {
zle kill-line
echo -n $CUTBUFFER | pbcopy
}
pb-kill-whole-line () {
zle kill-whole-line
echo -n $CUTBUFFER | pbcopy
}
texto = open('alice.txt').read().lower()
from string import punctuation
for c in punctuation:
texto = texto.replace(c, ' ')
texto = texto.split()
dic = {}
for p in texto:
if p not in dic:
dic[p] = 1
else:
anonymous
anonymous / markdown-folding.vim
Created November 26, 2012 18:41
A simple demo of how a foldexpr works in Vim. See http://vimcasts.org/e/28 for full explanation.
function! MarkdownFolds()
let thisline = getline(v:lnum)
if match(thisline, '^##') >= 0
return ">2"
elseif match(thisline, '^#') >= 0
return ">1"
else
return "="
endif
endfunction
@michalfapso
michalfapso / speak.pl
Last active January 10, 2024 00:52
Google Text-to-Speech script for processing longer texts
#!/usr/bin/perl
#--------------------------------------------------
# Usage:
# ./speak.pl en input.txt output.mp3
#
# Prerequisites:
# sudo apt-get install libwww-perl libhtml-tree-perl sox libsox-fmt-mp3
#
# Compiling sox:
@giudinvx
giudinvx / slideshare-downloader.sh
Last active November 17, 2022 01:00
Slideshare Downloader
#!/bin/bash
#-----------------------------------------------
# Modify 4/08/2018 by giudinvx
# Email giudinvx[at]gmail[dot]com
#-----------------------------------------------
# Author: Andrea Lazzarotto
# http://andrealazzarotto.com
# [email protected]
@igorburago
igorburago / indentguides.vim
Last active July 11, 2024 13:50
Vim indentation guides emulation
" Copyright 2022 Igor Burago. Distributed under the ISC License terms.
" Simple emulation of indentation guides.
"
" For tab-based indentation, using the 'listchars' option works fine.
" For space-based indentation, one can either:
" • use the match highlighting feature (see ':help match-highlight'),
" as shown in ToggleMatchHighlightIndentGuides(); or
" • use the 'leadmultispace' setting of the 'listchars' option (added
" in Vim 9.0), as shown in ToggleListCharsIndentGuides().
#!/bin/bash
_opts () {
perl -ne '
print if s/^.IP .\\fB\\-/-/ and s/\\(f(P|I|B|R)|)|".*//g;
print if s/^.IX Item .\-/-/ and s/"//g;
print if s/^.It Fl /-/;'
}
_man_generic() {