Skip to content

Instantly share code, notes, and snippets.

View telamonian's full-sized avatar

Max Klein telamonian

View GitHub Profile
@arulrajnet
arulrajnet / ChromeAppDownloader.py
Last active February 13, 2025 03:23
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
# -*- coding: utf-8 -*-
"""
Python Script to download the Chrome Extensions (CRX) file directly from the google chrome web store.
Referred from http://chrome-extension-downloader.com/how-does-it-work.php
"""
from __future__ import division
import argparse
import requests
@oktayacikalin
oktayacikalin / mount.py
Created October 20, 2013 07:14
How to mount a local volume using gvfs (gio) in Python 3 - quick and dirty.
#!/usr/bin/env python3
# Quick and dirty implementation of mounting a local volume using Gio.
# For people who were scratching their heads like me.
# Code below based on infos from:
# http://stackoverflow.com/questions/5709454/gio-check-if-volume-is-mounted
# http://stackoverflow.com/questions/1991206/accessing-samba-shares-with-gio-in-python/2051628#2051628
@hiko9lock
hiko9lock / TouchCamera.cs
Last active April 1, 2023 08:43
[Unity 3D] Testing camera pan,zoom, orbit for iOS. Setting camera target after you have attached this camera script to camera object.
using UnityEngine;
using System.Collections;
public class TouchCamera : MonoBehaviour {
public Transform target;
Vector3 f0Dir= Vector3.zero;
float zoomDistance= 5;
float theta= 0.0F;
float fai= 0.0F;
float dx= 0.0F;
@werediver
werediver / singleton.py
Created December 28, 2012 09:51
A thread safe implementation of singleton pattern in Python. Based on tornado.ioloop.IOLoop.instance() approach.
import threading
# Based on tornado.ioloop.IOLoop.instance() approach.
# See https://github.com/facebook/tornado
class SingletonMixin(object):
__singleton_lock = threading.Lock()
__singleton_instance = None
@classmethod
@jboner
jboner / latency.txt
Last active March 31, 2025 12:26
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD