Skip to content

Instantly share code, notes, and snippets.

@nic0-lab
nic0-lab / open-random-wiki-page.el
Last active October 4, 2021 18:02
Open a random wiki page from emacs.
(defun emacs-random-wiki-page ()
"Open a random page of emacs wiki."
(interactive)
(browse-url "https://www.emacswiki.org/emacs?action=random"))
(defun vim-random-wiki-page ()
"Open a random page of vim's wiki."
(interactive)
(browse-url "https://vim.fandom.com/wiki/Special:RandomInCategory/VimTip"))
@nic0-lab
nic0-lab / dwm_patches_list.md
Created June 29, 2020 18:23
List of dwm patches with the description

This is the list of patches for the dwm window manager from suckless.org, with description for each patch in one page.

activetagindicatorbar

This patch changes the rectangle indicating if a tag is used by a client into a bar above the tag name. Be sure to use a font which leaves enough space between the text of the tag name and the top of the bar.

actualfullscreen

Actually toggle fullscreen for a window, instead of toggling the status bar and the monocle layout.

@nic0-lab
nic0-lab / iframe_youtube_responsive.txt
Created July 12, 2019 08:05
Iframe Youtube Responsive
.video-container {
position: relative;
padding-bottom: 56.25%;
padding-top: 30px;
height: 0;
overflow: hidden;
}
.video-container iframe,
.video-container object,
(setq shackle-rules
'(((svg-2048-mode circe-query-mode) :same t)
("*Help*" :align t :select t)
("\\`\\*helm.*?\\*\\'" :regexp t :align t)
((compilation-mode "\\`\\*firestarter\\*\\'"
"\\`\\*magit-diff: .*?\\'") :regexp t :noselect t)
("\\`\\*cider-repl .*" :regexp t :align t :size 0.2)
((inferior-scheme-mode "*shell*" "*eshell*") :popup t))
shackle-default-rule '(:select t)
shackle-default-size 0.4
Zsh Daily Tips on Twitter Archive
2015-11-19
# Clean up file names and remove special characters
# $1 holds path $2 filename
zmv -n '(**/)(*)' '$1${2//[^A-Za-z0-9._]/_}
2015-11-16,"zmv '(*)' '${(L)1}' # lowercase file names
__BEGIN__
*vimtips.txt* For Vim version 8.0.
------------------------------------------------------------------------------
" new items marked [N] , corrected items marked [C]
" *best-searching*
/joe/e : cursor set to End of match
3/joe/e+1 : find 3rd joe cursor set to End of match plus 1 [C]
/joe/s-2 : cursor set to Start of match minus 2
/joe/+3 : find joe move cursor 3 lines down
/^joe.*fred.*bill/ : find joe AND fred AND Bill (Joe at start of line)
Zsh Daily Tips on Twitter Archive
2015-11-19
# Clean up file names and remove special characters
# $1 holds path $2 filename
zmv -n '(**/)(*)' '$1${2//[^A-Za-z0-9._]/_}
2015-11-16,"zmv '(*)' '${(L)1}' # lowercase file names
@nic0-lab
nic0-lab / Get-FtpDirectory.ps1
Created October 19, 2018 19:11 — forked from arthurdent/Get-FtpDirectory.ps1
Recursively list all files in FTP directory in PowerShell / List files (recursive)
$Server = "ftp://ftp.example.com/"
$User = "anonymous@example.com"
$Pass = "anonymous@anonymous.com"
Function Get-FtpDirectory($Directory) {
# Credentials
$FTPRequest = [System.Net.FtpWebRequest]::Create("$($Server)$($Directory)")
$FTPRequest.Credentials = New-Object System.Net.NetworkCredential($User,$Pass)
$FTPRequest.Method = [System.Net.WebRequestMethods+FTP]::ListDirectoryDetails
find . -type d -name "node_modules" -exec rm -rf {} \;