Skip to content

Instantly share code, notes, and snippets.

View live-wire's full-sized avatar

Dhruv Batheja live-wire

View GitHub Profile
@amr
amr / ConfigurationLoader.java
Last active November 11, 2023 18:43
Java simple YAML/JSON/Properties configuration mechanism with environment variable substitution/interpolation
public class ConfigurationLoader {
private final ObjectMapper objectMapper;
private final StringSubstitutor stringSubstitutor;
ConfigurationLoader() {
this.objectMapper = new ObjectMapper(new YAMLFactory());
this.stringSubstitutor =
new StringSubstitutor(StringLookupFactory.INSTANCE.environmentVariableStringLookup());
}
@n1chre
n1chre / emoji.txt
Created October 14, 2017 11:25
Unicode emojis
ʘ‿ʘ
Innocent face
ಠ_ಠ
Reddit disapproval face
(╯°□°)╯︵ ┻━┻
Table Flip / Flipping Table
┬─┬ ノ( ゜-゜ノ)
from graphviz import Digraph
import torch
from torch.autograd import Variable, Function
def iter_graph(root, callback):
queue = [root]
seen = set()
while queue:
fn = queue.pop()
if fn in seen:
@roachhd
roachhd / README.md
Last active April 21, 2024 16:53
EMOJI cheatsheet 😛😳😗😓🙉😸🙈🙊😽💀💢💥✨💏👫👄👃👀👛👛🗼🔮🔮🎄🎅👻

EMOJI CHEAT SHEET

Emoji emoticons listed on this page are supported on Campfire, GitHub, Basecamp, Redbooth, Trac, Flowdock, Sprint.ly, Kandan, Textbox.io, Kippt, Redmine, JabbR, Trello, Hall, plug.dj, Qiita, Zendesk, Ruby China, Grove, Idobata, NodeBB Forums, Slack, Streamup, OrganisedMinds, Hackpad, Cryptbin, Kato, Reportedly, Cheerful Ghost, IRCCloud, Dashcube, MyVideoGameList, Subrosa, Sococo, Quip, And Bang, Bonusly, Discourse, Ello, and Twemoji Awesome. However some of the emoji codes are not super easy to remember, so here is a little cheat sheet. ✈ Got flash enabled? Click the emoji code and it will be copied to your clipboard.

People

:bowtie: 😄

@Hodapp87
Hodapp87 / vtk_python_mesh.py
Created February 8, 2014 00:49
Simple VTK example in Python to load an STL mesh and display with a manipulator.
#!/bin/env python
"""
Simple VTK example in Python to load an STL mesh and display with a manipulator.
Chris Hodapp, 2014-01-28, (c) 2014
"""
import vtk
def render():
@tedmiston
tedmiston / webcam-cv2.py
Last active May 4, 2023 11:56
Display the webcam in Python using OpenCV (cv2)
"""
Simply display the contents of the webcam with optional mirroring using OpenCV
via the new Pythonic cv2 interface. Press <esc> to quit.
"""
import cv2
def show_webcam(mirror=False):
cam = cv2.VideoCapture(0)
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs