Skip to content

Instantly share code, notes, and snippets.

View kturney's full-sized avatar

Kyle Turney kturney

  • Toyota Connected
  • Dallas, TX
View GitHub Profile
@tim-evans
tim-evans / document-title.js
Created February 19, 2015 20:39
Document Title component
import Ember from "ember";
export default Ember.Component.extend({
isVirtual: true,
tagName: '',
render: function (buffer) {
let titleTag = document.getElementsByTagName('title')[0];
this._morph = buffer.dom.appendMorph(titleTag);
this._super.apply(this, arguments);
}
@jgilfelt
jgilfelt / ShameActivity.java
Created October 3, 2013 16:28
A base Activity class that allows the compatibility menu button (AKA "the menu button of shame") to be displayed for applications whose targetSdkVersion >= 11. On devices with a hard menu key there is no effect. Useful if you want to launch some sort of in-app debug UI from an on-screen affordance without altering your application's user interfa…
package com.example.shame;
import android.annotation.TargetApi;
import android.app.Activity;
import android.os.Build;
import android.view.KeyEvent;
import android.view.ViewConfiguration;
public abstract class ShameActivity extends Activity {
@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

@viktorklang
viktorklang / Actor.java
Last active February 13, 2023 12:13
Minimalist Java Actors
/*
Copyright 2012-2021 Viktor Klang
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software