Skip to content

Instantly share code, notes, and snippets.

View arlm's full-sized avatar

Alexandre Rocha Lima e Marcondes arlm

View GitHub Profile
@jimmy-collazos
jimmy-collazos / app.java
Created April 27, 2012 14:55
Class for check version instaled in Android App
import android.content.Context;
import android.content.SharedPreferences;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
public class App {
public static final String PREFERENCE_APP_KEY = "com.my.app.APP_PREFERENCE_PRIVATE";
public static final String PREFERENCE_VERSION_KEY = "com.my.app.APP_VERSION";
@domenic
domenic / 1flickrApi.js
Last active April 4, 2018 07:35
Flickr API experiments
"use strict";
// Uses jQuery and Q.
var API_KEY = "whatever";
function getFlickrResponseAsync(method, responseProperty, params) {
var deferred = Q.defer();
$.ajax("http://www.flickr.com/services/rest/", {
@klauswuestefeld
klauswuestefeld / gist:2644686
Created May 9, 2012 13:59
The Collaboration Void
We couldn’t find that file to show.
@klauswuestefeld
klauswuestefeld / gist:2775926
Created May 23, 2012 15:33
Skype Public Chat Room - Setting Up Your Own
We couldn’t find that file to show.
@jboner
jboner / latency.txt
Last active August 18, 2025 13:55
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
@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

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
</head>
<body>
<svg id="defs">
<defs>
<linearGradient id="gradBlue" x1="0%" y1="0%" x2="100%" y2="0%">
public static void SetAppearance()
{
if (Util.IsIOS5OrBetter)
{
UINavigationBar.Appearance.SetBackgroundImage(
Resources.NavBarHeaderBackground,
UIBarMetrics.Default);
UIBarButtonItem.Appearance.SetBackgroundImage(
Resources.BarButtonNormal.CreateResizableImage(new UIEdgeInsets(0,5,0,5)),
namespace MyApp
{
public static class Resources
{
public static UIImage Overview = UIImage.FromFile("images/tabbar_overview.png");
public static UIImage Records = UIImage.FromFile("images/tabbar_records.png");
public static UIImage Deadlines = UIImage.FromFile("images/tabbar_deadlines.png");
public static UIImage You = UIImage.FromFile("images/tabbar_you.png");
@jedschneider
jedschneider / gh-pages-tips.md
Created June 7, 2012 17:59
github pages tips for jekyll wiki

Working With Github Pages

The FAQ maintained by Github covers most stumbling blocks, some other tips and tricks supplied here.

Gitignore

Add _site to .gitignore. The generated site should not be uploaded to Github since its gets generated by github.

Working With Code Partials