Skip to content

Instantly share code, notes, and snippets.

View mntrskl's full-sized avatar
🎯
Focusing

Diego mntrskl

🎯
Focusing
View GitHub Profile
@mntrskl
mntrskl / search-keys.py
Created September 27, 2021 15:26
search files in directory recursively for keys in keys.txt
import os
import time
from dataclasses import dataclass
@dataclass
class File:
path = str
lines = []
static public class UnityEngineExtensions
{
/// <summary>
/// Returns the component of Type type. If one doesn't already exist on the GameObject it will be added.
/// </summary>
/// <typeparam name="T">The type of Component to return.</typeparam>
/// <param name="gameObject">The GameObject this Component is attached to.</param>
/// <returns>Component</returns>
static public T GetOrAddComponent<T>(this GameObject gameObject) where T : Component
{
{
"users": [
{
"picture": "http://placehold.it/128x128",
"age": 22,
"eyeColor": "brown",
"name": {
"first": "Sweeney",
"last": "Martinez"
},
@mntrskl
mntrskl / replacer.py
Last active June 13, 2017 19:57
Search value in JSON file, replace it and save converted (depth - surrounding)
"""KEYWORD REPLACING MODULE."""
import os
import json
# functions
def get_files():
"""lists files"""
exclude = set(['.vscode', 'sample'])
json_files = []
for root, dirs, files in os.walk(os.getcwd(), topdown=True):