Skip to content

Instantly share code, notes, and snippets.

View lavcraft's full-sized avatar
👻

Kirill Tolkachev lavcraft

👻
  • Tech Esthetics
  • Almaty
  • X @tolkv
View GitHub Profile
@lavcraft
lavcraft / show_me_resolution_snippet.js
Last active November 30, 2020 08:04
Show me your real resolution
`res: ${window.innerWidth}/${window.innerHeight}: devicePixelRatio: ${window.devicePixelRatio}`
#!/bin/bash
echo 'install dnsmasq and nslookup...'
yum -y install dnsmasq bind-utils
echo ' '
echo 'enable dnsmasq by default...'
systemctl enable dnsmasq
echo ' '
#topology:
# single instance app -> [broker4:9092, broker5:9092, broker6:9092] with 3 partition and replication factor 2 or 3 depends on cluster
auto.commit.interval.ms = 100
auto.offset.reset = latest
bootstrap.servers = [broker4:9092, broker5:9092, broker6:9092]
check.crcs = true
client.id =
connections.max.idle.ms = 540000
enable.auto.commit = true
def action = new ArtifactInfoAction("aaa")
currentBuild.rawBuild.addAction(action)
@org.kohsuke.stapler.export.ExportedBean
public class ArtifactInfoAction implements java.io.Serializable, hudson.model.Action {
private final String artifactName;
public ArtifactInfoAction(String artifactName) {
this.artifactName = artifactName;
}
buildscript {
repositories { jcenter() }
dependencies { classpath 'org.pegdown:pegdown:1.5.0' }
}
import org.pegdown.PegDownProcessor
task md {
def mp = new PegDownProcessor(org.pegdown.Extensions.ALL)
ext.outputDir = new File(buildDir, 'readme_html')
@lavcraft
lavcraft / java_verified_by_shipilev.java
Last active July 5, 2016 05:41
Напишите код, который для заданного диапазона чисел min..max
public class App {
public static void main(final String... args) {
final long begin = System.currentTimeMillis();
int[] ints = IntStream.range(0, Integer.MAX_VALUE)
.parallel()
.filter(App::check)
.toArray();
System.out.println("total numbers: " + ints.length + ", time: " +
public class App {
public static void main(final String... args) {
final long begin = System.currentTimeMillis();
int[] ints = IntStream.range(0, Integer.MAX_VALUE)
.parallel()
.filter(App::check)
.toArray();
System.out.println("total numbers: " + ints.length + ", time: " +
new SystemPropertyInjectionContainer("mongo:3", [
new Property('spring.data.mongodb.port', '$port27017'),
new Property('spring.data.mongodb.host', '$host')
]).withExposedPorts(MONGO_PORT)
java.lang.VerifyError: class net.sf.cglib.core.DebuggingClassWriter overrides final method visit.(IILjava/lang/String;Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;)V
at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)