Skip to content

Instantly share code, notes, and snippets.

View mohi7solanki's full-sized avatar
🤾‍♂️
Learning to make right tradeoffs.

Mohit Solanki mohi7solanki

🤾‍♂️
Learning to make right tradeoffs.
View GitHub Profile
{
"editor.fontSize": 18,
"files.autoSave": "off",
"python.linting.enabled": true,
"python.linting.pylintCategorySeverity.convention": "Error",
"python.linting.pylintCategorySeverity.refactor": "Error",
"python.linting.pylintUseMinimalCheckers": false,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.fontFamily": "Dejavu Sans Mono",
"window.zoomLevel": 1,
{
"editor.fontSize": 18,
"workbench.iconTheme": "vscode-icons",
"files.autoSave": "off",
"python.linting.pylintCategorySeverity.convention": "Error",
"python.linting.pylintCategorySeverity.refactor": "Error",
"python.linting.pylintUseMinimalCheckers": false,
"terminal.integrated.cursorStyle": "line",
"terminal.integrated.fontFamily": "Dejavu Sans Mono",
"window.zoomLevel": 1,
import hashlib
import os
import pickle
CACHE_DIR = '~/.playlist_length'
if not os.path.exists(CACHE_DIR):
os.makedirs(CACHE_DIR)
@mohi7solanki
mohi7solanki / get_files.py
Created March 25, 2018 18:07
Get all the files in a directory.
def get_all_files(BASE_PATH, no_subdir):
"""
Return a generator that yields all the files in the
directory you pass, if no_subdir is True it won't look
for files in sub-directories.
"""
def with_subdir():
for root, _, files in os.walk(BASE_PATH):
for file in files:
"""
Configuration example for ``ptpython``.
Copy this file to ~/.ptpython/config.py
"""
from __future__ import unicode_literals
from prompt_toolkit.filters import ViInsertMode
from prompt_toolkit.key_binding.input_processor import KeyPress
from prompt_toolkit.keys import Keys
from pygments.token import Token