This file contains 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
// Ctrl+Shift+C to open Chrome Console. | |
// Choose an IFrame of the Vimeo Video with a comment `player.vimeo.com` | |
// in the drop-down list `top`. | |
// Run a script: | |
var videos = []; | |
$$('script')[3].textContent.match(/\{[^{]+?mp4[^}]+?\}/g).forEach( | |
x => { o = JSON.parse(x); | |
videos.push(o);}); | |
videos.sort((a, b) => a.quality.localeCompare(b.quality)).forEach( |
This file contains 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 the prefix to ^A. | |
unbind C-b | |
set -g prefix ^A | |
bind a send-prefix | |
# Start windows and panes at 1, not 0 | |
set -g base-index 1 | |
set -g pane-base-index 1 | |
set -g renumber-windows on |
This file contains 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
" plugins | |
let need_to_install_plugins = 0 | |
if empty(glob('~/.vim/autoload/plug.vim')) | |
silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs | |
\ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim | |
let need_to_install_plugins = 1 | |
endif | |
call plug#begin() | |
Plug 'tpope/vim-sensible' |
This file contains 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
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.
- By Edmond Lau
- Highly Recommended 👍
- http://www.theeffectiveengineer.com/
This file contains 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
#!/usr/bin/env python3 | |
"""Compare (fuzzy) dateutils vs dateparser `parse` methods""" | |
import sys | |
from dateparser import parse as dp_parse | |
from datetime import datetime, timedelta | |
from dateutil.parser import parse as du_parse | |
NOW = datetime.now() |
This file contains 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
substitute_dictionary = {'EmaIL':'Email ID','PhOne':'Telephone No.','CIty':'City/country'} | |
list_elements = ['EmaIL','PhOne','CIty'] | |
replaced_list_elements = [substitute_dictionary.get(element,item) for element in list_elements] | |
print 'Original List:',list_elements | |
print 'List elements replaced as per dictionary o/p:',replaced_list_elements | |
# Original List: ['EmaIL', 'PhOne', 'CIty'] | |
# List elements replaced as per dictionary o/p: ['Email ID', 'Telephone No.', 'City/country'] |
NewerOlder