Skip to content

Instantly share code, notes, and snippets.

View artem-zinnatullin's full-sized avatar
:shipit:

Artem Zinnatullin artem-zinnatullin

:shipit:
View GitHub Profile
@rylev
rylev / rust-in-large-organizations-notes.md
Last active February 2, 2023 10:08
Rust in Large Organizations Notes

Rust in Large Organizations

Initially taken by Niko Matsakis and lightly edited by Ryan Levick

Agenda

  • Introductions
  • Cargo inside large build systems
  • FFI
  • Foundations and financial support
@smola
smola / k8s-jprofiler-attach.sh
Created March 23, 2018 14:49
Attach JProfiler agent to a JVM running in a Kubernetes pod
#!/bin/bash
set -e
if [[ -z ${K8S_JVM_POD} ]]; then
echo "K8S_JVM_POD not defined"
exit 1
fi
EXEC="kubectl exec ${K8S_JVM_POD}"
CP="kubectl cp ${K8S_JVM_POD}"
@ZacSweers
ZacSweers / DiscussionGuidelines.md
Created November 20, 2017 07:04
Discussion guidelines

Guidelines

To keep the arguments and examples to the point there are few helpful rules:

  • No abstract examples/arguments. These cause the discussion to lose focus and make examples harder to follow. The example/argument must be traceable to a real-world problem - ___ is intended to solve real problems, not imaginary ones.
  • Examples must show the full complexity of the problem domain. Simplified examples trivialize the problems and the solutions intended to solve those simplified examples may not work for the complex problems.
  • Examples of problematic ___ code must be the “best way” of writing the code in ___ - if it can be improved then the improved version should be used instead.
  • Arguments must be straight to the point and as concise as possible.
  • Arguments should take the point of view of an average programmer - not the über-programmer who doesn’t make design mistakes.
@thevery
thevery / DrivingInUS.md
Last active February 7, 2019 15:14
Notices about driving in US
  • Нерегулируемые перекрёстки обычно обозначаются знаком Stop (и часто дополнительной табличкой 4-way/all way), на них действует правило FIFO - кто первый приехал на перекрёсток, тот первым и уехал с него. Останавливаться, конечно, нужно обязательно.
  • Иногда одна дорога бывает условно-главной или строго второстепенной и тогда stop стоит только на другой, определить наличие знака справа-слева помогает наличие стоп-линии и слова STOP на асфальте. На второй год вождения на больших дорогах без STOP-а я на перекрёстках уже не тормозил :)
  • Yield - уступи дорогу.
  • Пешеходный перевод часто бывает не зеброй, а просто двумя параллельными линиями. - Ildar Karimov
  • Регулируемые перекрёстки похожи на наши, но светофор и знаки располагаются за перекрёстком. Из важных отличий:
  • Для поворота налево в 90% случаев есть отдельная полоса (расширение дороги либо специальная жёлтая разметка) и отдельный светофор из трёх секций (все три в виде стрелки). Если красной стрелки нет, значит поворачивать нужно как в России
@artem-zinnatullin
artem-zinnatullin / GradleWorkersPleaseStopTakingFocus.gradle
Created July 21, 2015 19:58
Prevent Gradle Workers from taking focus! #DevelopersLikeComfort
// You can place it in the root build.gradle
allprojects {
tasks.withType(JavaForkOptions) {
// Forked processes like GradleWorkerMain for tests won't steal focus!
jvmArgs '-Djava.awt.headless=true'
}
}
@JakeWharton
JakeWharton / ShampooRule.java
Last active August 31, 2023 15:47
Got flaky tests? Shampoo them away with a quick JUnit rule. Apache 2.
import org.junit.rules.TestRule;
import org.junit.runner.Description;
import org.junit.runners.model.Statement;
/** Got flaky tests? Shampoo them away. */
public final class ShampooRule implements TestRule {
private final int iterations;
public ShampooRule(int iterations) {
if (iterations < 1) throw new IllegalArgumentException("iterations < 1: " + iterations);
@JakeWharton
JakeWharton / AutoGson.java
Last active November 28, 2021 12:32
A Gson TypeAdapterFactory which allows serialization of @autovalue types. Apache 2 licensed.
import com.google.auto.value.AutoValue;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* Marks an {@link AutoValue @AutoValue}-annotated type for proper Gson serialization.
* <p>
@artem-zinnatullin
artem-zinnatullin / build.gradle
Created July 17, 2014 07:30
Gradle & Android: Disable/Enable preDexing
// add this to the general build.gradle, not in the subproject's build.gradle
// improved version of Xavier's tip http://tools.android.com/tech-docs/new-build-system/tips#TOC-Improving-Build-Server-performance.
// usage example default, preDex will be enabled: gradle clean build
// usage example disabling preDex: gradle clean build -PpreDexEnable=false
// preDexEnable parameter's value can be set as property of Continuous Integration build config
// this is the main difference from Xavier's workaround where he doing only hasProperty check
project.ext {
if (project.hasProperty('preDexEnable')) {
@dmarcato
dmarcato / strip_play_services.gradle
Last active December 21, 2022 10:10
Gradle task to strip unused packages on Google Play Services library
def toCamelCase(String string) {
String result = ""
string.findAll("[^\\W]+") { String word ->
result += word.capitalize()
}
return result
}
afterEvaluate { project ->
Configuration runtimeConfiguration = project.configurations.getByName('compile')
@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing