Skip to content

Instantly share code, notes, and snippets.

View Maccimo's full-sized avatar

Maxim Degtyarev Maccimo

View GitHub Profile
@rednaxelafx
rednaxelafx / PrintThreadIds.java
Created February 25, 2011 10:31
find out the correspondence between the tid/nid of Java threads as shown from jstack/JMX, on HotSpot/Linux
package fx.jvm.hotspot.tools;
import java.util.List;
import sun.jvm.hotspot.tools.Tool;
public class PrintThreadIds extends Tool {
public static void main(String[] args) {
PrintThreadIds tool = new PrintThreadIds();
tool.start(args);
@valadan
valadan / latency.markdown
Created September 14, 2012 11:41 — forked from hellerbarde/latency.markdown
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

@ahmpro
ahmpro / habr.htm
Last active August 29, 2015 14:07
Хабрахабр — профилактика
<!DOCTYPE html>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Хабрахабр / Профилактические работы</title>
<meta charset="utf-8">
<meta content="width=device-width,initial-scale=1,user-scalable=no" name="viewport">
<style>
@font-face {
font-family: 'PT Sans';
font-style: normal;
@edin-m
edin-m / html5-video-play-file-blob.html
Last active May 17, 2024 07:45
HTML video play file blob object url
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<video></video>
<br/>
<input type="file" name="file" id="fileItem" onchange="onChange()" >
@DrPizza
DrPizza / thunks.cpp
Last active November 22, 2017 19:02
__pragma(optimize("", off))
__pragma(runtime_checks("", off))
__pragma(check_stack(off))
__pragma(strict_gs_check(push, off))
// anonymous namespace to ensure that the function names are not exported,
// and hence that I can take their address without suffering indirections
namespace {
__pragma(code_seg(push, "thunks"))
@reflechant
reflechant / dict-client.py
Last active February 2, 2017 08:35
A simple command-line client for Yandex.Translate service
#!/usr/bin/env python3
# A simple command-line client for Yandex.Translate.
# You may pass translate direction as command line parameter e.g. "./dict-client.py fr-en"
# Default translate direction is from English to Russian.
#!/usr/bin/env python3
import requests
import sys
@raphw
raphw / Foo.java
Last active January 19, 2016 13:22
Receiver type overview
public class Foo<T> {
class Bar<S> {
Bar(Foo<T> Foo.this) {}
void bar(Foo<T>.Bar<S> this) {}
}
static class Qux<S> {
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@nstarke
nstarke / release-android-debuggable.md
Last active June 26, 2024 15:20
How to make a Release Android App debuggable

How to make a Release Android App debuggable

Let's say you want to access the application shared preferences in /data/data/com.mypackage.
You could try to run adb shell and then run-as com.mypackage ( or adb shell run-as com.mypackge ls /data/data/com.mypackage/shared_prefs), but on a production release app downloaded from an app store you're most likely to see:

run-as: Package 'com.mypackage' is not debuggable
@avafloww
avafloww / PhpJava.java
Last active June 13, 2024 07:36
This snippet of code is syntactically valid in both PHP and Java, and produces the same output in both.
/*<?php
//*/public class PhpJava { public static void main(String[] args) { System.out.printf("/*%s",
//\u000A\u002F\u002A
class PhpJava {
static function main() {
echo(//\u000A\u002A\u002F
"Hello World!");
}}
//\u000A\u002F\u002A
PhpJava::main();