Skip to content

Instantly share code, notes, and snippets.

View mannyanebi's full-sized avatar
🔥
Stay Awesome!

Emmanuel Anebi mannyanebi

🔥
Stay Awesome!
View GitHub Profile
@mannyanebi
mannyanebi / object_to_dict_recursive.py
Created August 24, 2023 23:25 — forked from sairamkrish/object_to_dict_recursive.py
Python object to dictionary - recursively convert
'''
Generic object to dict converter. Recursively convert.
Useful for testing and asserting objects with expectation.
'''
def todict(obj, classkey=None):
if isinstance(obj, dict):
data = {}
for (k, v) in obj.items():
data[k] = todict(v, classkey)
@mannyanebi
mannyanebi / deep_transform.py
Created December 17, 2022 20:35 — forked from martin056/deep_transform.py
Deep snake_case and camelCase transformations
import re
from typing import Dict, Callable, Optional
def to_camel_case(snake_case_str: str) -> str:
"""
Transforms snake_case to camelCase
"""
components = snake_case_str.split('_')
titled_components = ''.join(x.title() for x in components[1:])
@mannyanebi
mannyanebi / nvmCommands.js
Created April 23, 2022 20:18 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node