Skip to content

Instantly share code, notes, and snippets.

View AndrejJurkin's full-sized avatar

Andrej Jurkin AndrejJurkin

View GitHub Profile
[
{
"key": "cmd+d",
"command": "editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
},
{
"key": "ctrl+shift+k",
"command": "-editor.action.deleteLines",
"when": "textInputFocus && !editorReadonly"
<div class="flex justify-center items-center w-full h-screen relative">
<h1
class="px-12 mb-36 pt-12 bg-white mix-blend-screen text-[18rem] font-black z-10"
>
BLEND
</h1>
<video
src="/train.mp4"
autoplay
loop
@AndrejJurkin
AndrejJurkin / gist:6dbc6a8f09493b12cbd51a57b867dada
Created March 4, 2023 17:22
Minimalistic VS Code settings
{
"editor.tabSize": 2,
"editor.fontSize": 14,
"editor.formatOnSave": true,
"workbench.iconTheme": "vscode-icons",
"editor.renderWhitespace": "all",
"editor.minimap.enabled": false,
"editor.renderLineHighlight": "none",
"editor.mouseWheelZoom": true,
"workbench.layoutControl.type": "menu",
@AndrejJurkin
AndrejJurkin / gist:f0c97ee848a0e2ee7b4920884e698c1f
Created October 4, 2017 12:29
ScrollView with auto-layout
- Add a Scroll View as a Sub View of the Main View
- Select the Scroll View and uncheck "Constrain to margins" and pin top, left, right, bottom, constraints
- Add a UIView as a subview of the Scroll View. Name this view "Content View"
- Select the Content View and pin top, left, right, and bottom constraints. Then add a center horizontally constraint.
- Next from the Content View to the Main View add equal width and equal height constraints.
git log --shortstat --pretty="%cE" | sed 's/\(.*\)@.*/\1/' | grep -v "^$" | awk 'BEGIN { line=""; } !/^ / { if (line=="" || !match(line, $0)) {line = $0 "," line }} /^ / { print line " # " $0; line=""}' | sort | sed -E 's/# //;s/ files? changed,//;s/([0-9]+) ([0-9]+ deletion)/\1 0 insertions\(+\), \2/;s/\(\+\)$/\(\+\), 0 deletions\(-\)/;s/insertions?\(\+\), //;s/ deletions?\(-\)//' | awk 'BEGIN {name=""; files=0; insertions=0; deletions=0;} {if ($1 != name && name != "") { print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net"; files=0; insertions=0; deletions=0; name=$1; } name=$1; files+=$2; insertions+=$3; deletions+=$4} END {print name ": " files " files changed, " insertions " insertions(+), " deletions " deletions(-), " insertions-deletions " net";}'
@AndrejJurkin
AndrejJurkin / Queue impl
Created June 18, 2017 17:24
Queue impl using linked list
public class Queue<T> {
private static class Node<T> {
private T data;
private Node<T> next;
public Node(T data) {
this.data = data;
}
}
@AndrejJurkin
AndrejJurkin / Stack impl
Last active June 18, 2017 17:09
Stack implementation using linked list
public class Stack<T> {
private static class Node<T> {
private T data;
private Node<T> next;
public Node(T data) {
this.data = data;
}
}
@AndrejJurkin
AndrejJurkin / ApiModule
Created June 9, 2017 10:08
Dagger module that provides a basic Retrofit - Gson - OkHttp - RxJava setup
@Module
public final class ApiModule {
private static final int OK_HTTP_CACHE_SIZE = 10 * 1024 * 1024;
private static final String GSON_DATE_FORMAT = "yyyy-MM-dd";
private String baseUrl;
private String apiKey;
public ApiModule(String baseUrl, String apiKey) {
this.baseUrl = baseUrl;
public void bfs(TreeNode root) {
if (root == null) {
return;
}
Queue<TreeNode> queue = new LinkedList<>();
queue.add(root);
while(!queue.isEmpty()) {
TreeNode node = queue.remove();