Skip to content

Instantly share code, notes, and snippets.

@ykrkn
ykrkn / UploadFiles.css
Last active March 12, 2021 11:09
blueprintjs react upload file
.UploadFiles {
border: 1px solid grey;
box-shadow: 0px 0px 6px 6px #ccc;
border-radius: 16px;
width: 600px;
position: absolute;
left: calc(50% - 300px);
top: 200px;
}
@ykrkn
ykrkn / gist:7492c05cb436bc3eed0ee15ba7263a8f
Created July 30, 2019 16:15
count words in react project
package sx;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Map;
import java.util.stream.Collectors;
@ykrkn
ykrkn / com.ykrkn.screencapture.plist
Created January 9, 2019 11:08
mac os x launch agent for screen capture
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.ykrkn.screencapture</string>
<key>UserName</key>
<string>sx</string>
<key>WorkingDirectory</key>
<string>/Users/yurykrikun/Documents/screencapture</string>
@ykrkn
ykrkn / es6 async await fetch
Created August 31, 2017 15:31
es6 async await fetch
class API {
constructor(url){
this.BASE_URL = url;
}
async post(url, data) {
const response = await fetch(this.BASE_URL + url, {
method: "POST",
headers: {'Content-Type': 'application/json'},
body: JSON.stringify(data)
\copy (select '<location title="'||locations.title||'" lat="'||latitude||'" lng="'||longitude||'" />' from locations left join spatial on spatial.loc_id=locations.loc_id where latitude is not null and wkt is null union all select '<location title="'||locations.title||'" lat="'||latitude||'" lng="'||longitude||'" wkt="'||spatial.wkt||'" />' from locations left join spatial on spatial.loc_id=locations.loc_id where latitude is not null and wkt is not null) TO 'spatial.xml'
@ykrkn
ykrkn / gist:ccdc907b42518777c42188c101ea1864
Created July 18, 2016 06:15
CompletableFuture Actor Graph
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
import java.util.concurrent.CountDownLatch;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static java.util.concurrent.CompletableFuture.completedFuture;
/**
@ykrkn
ykrkn / gist:a0f1f004faff48340719debc4a62a246
Created July 15, 2016 13:23
CompletableFuture Actor chain
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CountDownLatch;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;
import java.util.stream.Stream;
import static java.util.concurrent.CompletableFuture.supplyAsync;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.Consumer;
import java.util.function.Supplier;
/**
* Created by sx on 26.02.16.
*/
public class Main implements Supplier<Double>, Consumer, Runnable{
ab -s 120 -k -p post.json -T application/json -c 1 -n 1000 -g out.dat http://localhost:8080/api/datas/ZZZ
gnuplot plot.p
plot.p
# Output to a jpeg file
set terminal jpeg size 1280,720
@ykrkn
ykrkn / Main.java
Created February 25, 2016 22:29
Infinite stream
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicLong;
/**
* InfiniteStream.java
* https://gist.github.com/bassemZohdy/e5fdd56de44cea3cd8ff
* Created by sx on 26.02.16.
*/
public class Main {