Skip to content

Instantly share code, notes, and snippets.

View michaelmendoza's full-sized avatar

Michael Mendoza michaelmendoza

View GitHub Profile
@michaelmendoza
michaelmendoza / io.py
Last active March 16, 2023 17:08
A contextmanager to block output from print()
from contextlib import contextmanager
import sys, os
@contextmanager
def suppress_stdout():
with open(os.devnull, "w") as devnull:
old_stdout = sys.stdout
sys.stdout = devnull
try:
yield
@michaelmendoza
michaelmendoza / DestroyChildren.cs
Last active January 29, 2019 18:56
Unity Script to destroy all children gameobjects
public void destroyChildren(GameObject gameObject) {
foreach (Transform child in gameObject.transform)
GameObject.Destroy(child.gameObject);
}
@michaelmendoza
michaelmendoza / Procfile
Created March 11, 2016 20:31
Using Brunch with Heroku
web: node server.js
@michaelmendoza
michaelmendoza / 0_reuse_code.js
Last active August 29, 2015 14:15
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console