Skip to content

Instantly share code, notes, and snippets.

View lastorset's full-sized avatar

Leif Arne Storset lastorset

  • Opera Software
  • Oslo, Norway
View GitHub Profile
@lastorset
lastorset / android_version_codes.txt
Created September 25, 2015 15:22 — forked from anonymous/android_version_codes.txt
A printable overview of Android version codes
android.os.
API level Build.VERSION_CODES Version Code name
1 BASE 1.0 (no code name)
2 BASE_1_1 1.1 (no code name)
3, NDK 1 CUPCAKE 1.5 Cupcake
4, NDK 2 DONUT 1.6 Donut
5 ECLAIR 2.0 Eclair
6 ECLAIR_0_1 2.0.1 Eclair
7, NDK 3 ECLAIR_MR1 2.1 Eclair
8, NDK 4 FROYO 2.2.x Froyo
@lastorset
lastorset / cpuirq
Created March 21, 2017 16:41 — forked from sveniu/cpuirq
#!/bin/sh
# Enumerate all interrupts used by either the default or a specified
# network interface, and map them to separate CPUs. Each CPU that gets
# assigned interrupts will also have its C-states deeper than C1
# disabled to reduce the probability of rx queue overflow.
#
# TODO: NUMA interrupt scheduling.
#
@lastorset
lastorset / cpuirq
Created March 21, 2017 16:41 — forked from sveniu/cpuirq
#!/bin/sh
# Enumerate all interrupts used by either the default or a specified
# network interface, and map them to separate CPUs. Each CPU that gets
# assigned interrupts will also have its C-states deeper than C1
# disabled to reduce the probability of rx queue overflow.
#
# TODO: NUMA interrupt scheduling.
#
@lastorset
lastorset / gist:02516c19747f1e3e4c3d4e593876d6f3
Created February 1, 2018 13:51 — forked from aukalas/gist:d84c6c6816eac1b246fc82b9ec5e33c2
Google AppEngine URLFetch in Unit Tests
from google.appengine.api import apiproxy_stub
from google.appengine.api import apiproxy_stub_map
class FetchServiceMock(apiproxy_stub.APIProxyStub):
def __init__(self, service_name='urlfetch'):
super(FetchServiceMock, self).__init__(service_name)
def set_return_values(self, **kwargs):
self.return_values = kwargs
@lastorset
lastorset / fetch_service_mock.py
Last active October 21, 2023 22:55 — forked from kesor/gist:1179782
Google AppEngine URLFetch in Unit Tests
from google.appengine.api import apiproxy_stub, apiproxy_stub_map, urlfetch
from google.appengine.ext import testbed
import unittest
class FetchServiceMock(apiproxy_stub.APIProxyStub):
"""
Example::
with FetchServiceMock(content='A MOCKERY', status_code=200) as fetch_mock:
ret = main.method('amok')