Skip to content

Instantly share code, notes, and snippets.

View oyewunmio's full-sized avatar
💭
INQUISITIVE

oyewunmi oluwaseyi oyewunmio

💭
INQUISITIVE
View GitHub Profile
@oyewunmio
oyewunmio / vscode-macos-context-menu.md
Created January 21, 2024 12:00 — forked from idleberg/vscode-macos-context-menu.md
“Open in Visual Studio Code” in macOS context-menu

Open in Visual Studio Code

  • Open Automator
  • Create a new document
  • Select Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
    • your default shell should already be selected, otherwise use /bin/zsh for macOS 10.15 (”Catalina”) or later
    • older versions of macOS use /bin/bash
  • if you're using something else, you probably know what to do 😉
@oyewunmio
oyewunmio / ipython_to_file.md
Created June 2, 2022 13:50 — forked from awesomebytes/ipython_to_file.md
Save iPython session to a python file as code

Save an iPython session commands/code to a file

You must use the magic method %save:

In [1]: %save?
Type:       Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace:  IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
@oyewunmio
oyewunmio / rename.py
Created October 11, 2021 03:50
Stackoverflow answer to renaming directory
# importing modules
import os
import shutil
import sys
#ask user directory
file_dir = input('Enter directory path of containing files to work on only')
#change to working directory
os.chdir(file_dir)