Skip to content

Instantly share code, notes, and snippets.

View kirillzh's full-sized avatar
☀️

Kirill Zhukov kirillzh

☀️
View GitHub Profile
@atcuno
atcuno / gist:3425484ac5cce5298932
Last active March 25, 2024 13:55
HowTo: Privacy & Security Conscious Browsing

The purpose of this document is to make recommendations on how to browse in a privacy and security conscious manner. This information is compiled from a number of sources, which are referenced throughout the document, as well as my own experiences with the described technologies.

I welcome contributions and comments on the information contained. Please see the How to Contribute section for information on contributing your own knowledge.

Table of Contents

@polbins
polbins / README.md
Last active June 20, 2022 02:50
Android Studio as default Git Diff Tool

Create Android Studio Command-line Launcher

  1. Open Android Studio
  2. Go to: Tools > Create Command-line Launcher
  3. Leave as default, Press OK

Configure Git to use Android Studio as default Diff Tool

  1. Add the following lines to your .gitconfig
@saxophone
saxophone / ResultTestActivity.java
Last active October 13, 2020 14:43
Use Android Espresso to test that your Activity finishes with the expected result.
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
import org.hamcrest.TypeSafeMatcher;
import static android.support.test.InstrumentationRegistry.getInstrumentation;
import static org.hamcrest.MatcherAssert.assertThat;
require 'net/http'
require 'json'
# 此类只是检测 token 是否有效
# 如果前端有传 user_id 和 email 过来,其值还需与接口返回的值对比
class AuthTokenUtil
class << self
=begin
@adavis
adavis / BeforeLoginActivityTest.java
Last active April 7, 2022 13:58
Using Screen Robots with Android Espresso Tests
package <your_package>;
import android.support.test.espresso.intent.rule.IntentsTestRule;
import android.support.test.runner.AndroidJUnit4;
import android.test.suitebuilder.annotation.LargeTest;
import org.junit.After;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;
@e2
e2 / stopping_backward_compatibility_madness.md
Last active April 8, 2020 05:30
How to stop the "Backward Compatibility Cult" before it kills Ruby.

How to stop the "Backward Compatibility Cult" before it kills Ruby.

  1. It's irresponsible to support Ruby < 2.2. A Ruby version is not "supported" if it's only getting security fixes. Because "support" means fixing bugs. And any Ruby version < 2.2 is rife with "never-to-be-fixed" bugs that can occur at any time. A minor OS upgrade, a minor gem upgrade ... and suddenly a new (or old) bug is triggered and Ruby crashes every time. At this point, the user may be forced to upgrade (at the most inconvenient time possible). The only other option is for everyone to implement some obscure workaround to side-step the bug in their outdated Ruby version. Ridiculous effort and costs just to keep a likely vulnerable (and definitely broken - even if it "works") version of Ruby around.

  2. Ruby 2.2.4 fixes an important vulnerability. There is a patch-level version of Ruby 2.0 (patch-level in code terms, not SemVer) and a minor of Ruby 2.1.9 to solve t

@wispborne
wispborne / KotlinComparisonClass.java
Last active August 17, 2020 19:42
Comparison of Java to Kotlin for various simple methods.
/** Example of a {@link Class} declaration */
public final class MyClass {
private boolean someBool;
public MyClass() {
}
public MyClass(boolean someBool) {
this.someBool = someBool;
}
@jdmaturen
jdmaturen / company-ownership.md
Last active July 29, 2023 22:39
Who pays when startup employees keep their equity?

Who pays when startup employees keep their equity?

JD Maturen, 2016/07/05, San Francisco, CA

As has been much discussed, stock options as used today are not a practical or reliable way of compensating employees of fast growing startups. With an often high strike price, a large tax burden on execution due to AMT, and a 90 day execution window after leaving the company many share options are left unexecuted.

There have been a variety of proposed modifications to how equity is distributed to address these issues for individual employees. However, there hasn't been much discussion of how these modifications will change overall ownership dynamics of startups. In this post we'll dive into the situation as it stands today where there is very near 100% equity loss when employees leave companies pre-exit and then we'll look at what would happen if there were instead a 0% loss rate.

What we'll see is that employees gain nearly 3-fold, while both founders and investors – particularly early investors – get dilute

-Xms1G
-Xmx4G
-XX:MaxPermSize=2G
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-XX:MetaspaceSize=512m
@Arinerron
Arinerron / permissions.txt
Last active March 27, 2024 04:59
A list of all Android permissions...
android.permission.ACCESS_ALL_DOWNLOADS
android.permission.ACCESS_BLUETOOTH_SHARE
android.permission.ACCESS_CACHE_FILESYSTEM
android.permission.ACCESS_CHECKIN_PROPERTIES
android.permission.ACCESS_CONTENT_PROVIDERS_EXTERNALLY
android.permission.ACCESS_DOWNLOAD_MANAGER
android.permission.ACCESS_DOWNLOAD_MANAGER_ADVANCED
android.permission.ACCESS_DRM_CERTIFICATES
android.permission.ACCESS_EPHEMERAL_APPS
android.permission.ACCESS_FM_RADIO