Skip to content

Instantly share code, notes, and snippets.

View nipunsadvilkar's full-sized avatar
:octocat:
Focusing

Nipun Sadvilkar nipunsadvilkar

:octocat:
Focusing
View GitHub Profile
@dmlogv
dmlogv / download-vimeo-video.js
Created June 28, 2020 11:11
Download private embed Vimeo video
// 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(
@miguelgrinberg
miguelgrinberg / .tmux.conf
Last active March 15, 2022 11:39
My .tmux.conf file for working with tmux
# 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
@miguelgrinberg
miguelgrinberg / .vimrc
Last active September 15, 2024 18:50
My .vimrc configuration for working in Python with vim
" 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'
@lizthegrey
lizthegrey / attributes.rb
Last active September 24, 2024 14:33
Hardening SSH with 2fa
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active November 16, 2024 18:12
set -e, -u, -o, -x pipefail explanation
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active November 16, 2024 22:55
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@peterroelants
peterroelants / Gradient_Descent_animation.ipynb
Created May 21, 2017 07:55
Matplotlib Gradient Descent Animation
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.


Effective Engineer - Notes

What's an Effective Engineer?

@jmaupetit
jmaupetit / dateparser_vs_dateutil.py
Created October 6, 2016 15:57
dateparser.parse vs dateutil.parser.parse
#!/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()
@nipunsadvilkar
nipunsadvilkar / list_element_replace_AsPer_dict.py
Created July 22, 2016 06:10
Replacing list elements with key:value elements of dictionary
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']