Skip to content

Instantly share code, notes, and snippets.

View Maccimo's full-sized avatar

Maxim Degtyarev Maccimo

View GitHub Profile
@gbrow004
gbrow004 / ubuntu-MBP-16.md
Last active April 19, 2024 11:40
Ubuntu on Apple Macbook Pro 16-inch (2019)

Update!

This gist is out of date and I can no longer help much, as I got rid of my Mac.

Please visit T2 Linux website for more and better information:

https://t2linux.org/

Acknowledgements

This gist is just a compilation of the hard work that others have put in. I'm not a software developer, so if there are any mistakes or better ways of doing things, I'd appreciate any suggestions. Here's a list of the real heroes who made this possible:

@avafloww
avafloww / PhpJava.java
Last active October 16, 2022 18:50
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();
@nstarke
nstarke / release-android-debuggable.md
Last active April 28, 2024 16:29
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
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@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> {
@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
@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"))
@edin-m
edin-m / html5-video-play-file-blob.html
Last active April 6, 2024 19:32
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()" >
@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;
@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