Skip to content

Instantly share code, notes, and snippets.

View Radiokot's full-sized avatar
🐍

Oleg Koretsky Radiokot

🐍
View GitHub Profile
@obfusk
obfusk / README.md
Last active December 27, 2024 06:54
baseline.profm not deterministic
@trygvea
trygvea / ShortestPathAlgorithm.kt
Created January 13, 2021 11:53
Djikstras shortest path algorithm in kotlin
package algorithms.shortestpath
interface Node
data class Edge(val node1: Node, val node2: Node, val distance: Int)
/**
* See https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
*/
fun findShortestPath(edges: List<Edge>, source: Node, target: Node): ShortestPathResult {
@straker
straker / README.md
Last active September 11, 2024 17:17
Basic Missile Command HTML and JavaScript Game

Basic Missile Command HTML and JavaScript Game

This is a basic implementation of the Atari Missile Command game, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Score
  • When a missile explodes (not a counter-missile), the score should increase by 25
@joewalnes
joewalnes / jar-launcher.md
Last active December 10, 2023 11:58
Make a single file Java jar launcher

This is a little trick to turn an executable Java jar.

It works on all unixy like systems including Linux, MacOS, Cygwin, and Windows Linux subsystem.

Step 1 Start with an all-in-one jar (with entry point and all deps within)

$ ls 
hello.jar
@jalcantarab
jalcantarab / _jsonPuller.md
Last active March 11, 2025 23:14 — forked from crstamps2/jsonPuller
A Google apps script to pull json from a spreadsheet

JSON Puller - Google Apps Script

Transforms the data of a given Spreadsheet Sheet to JSON.

  • The frozen rows are taken as keys for the JSON.
  • The data taken for the values is only that after the frozen rows

Set up:

exportJSON(Spreadsheet) - transforms the data in the given sheet to JSON.

DB_DIRECTORY = /var/electrumx
USERNAME = electrumx
ELECTRUMX = /usr/local/bin/electrumx_server.py
#Bitcoin Node RPC Credentials
DAEMON_URL = http://user:pass@IPaddress:port/
#port is optional, defaults to COIN RPC default
#
#REQUIRED FOR PUBLIC VISIBILITY
@vuklip
vuklip / markdown.md
Last active September 21, 2023 20:44
markdown extention
инструкция что делает
<sub>text</sub> подстрочный текст
<sup>text</sup> надстрочный текст
<ins>text</ins> подчеркнутый текст
&nbsp; отступ. втыкать столько роз сколько необходимо
<sup id="a1">[1](#f1)</sup> сноска
<b id="f1">1</b> Footnote. [↩](#a1) куда ссылается
@hungps
hungps / okhttp3.WebviewCookieHandler.java
Last active January 6, 2024 11:39
Cookie jar that handles syncing okhttp cookies with Webview cookie manager
import android.webkit.CookieManager;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.HttpUrl;
@codezjx
codezjx / CircleImageTransformation.java
Last active July 28, 2023 12:15
A picasso circle image transformation. Optimized version of: https://gist.github.com/julianshen/5829333. Use shader.setLocalMatrix() method to draw circle bitmap not from source bitmap left-top. So, we no need to create square bitmap!
/**
* Created by codezjx on 2016/5/4.
*/
public class CircleImageTransformation implements Transformation {
/**
* A unique key for the transformation, used for caching purposes.
*/
private static final String KEY = "circleImageTransformation";
@joepie91
joepie91 / vpn.md
Last active April 19, 2025 00:38
Don't use VPN services.

Don't use VPN services.

No, seriously, don't. You're probably reading this because you've asked what VPN service to use, and this is the answer.

Note: The content in this post does not apply to using VPN for their intended purpose; that is, as a virtual private (internal) network. It only applies to using it as a glorified proxy, which is what every third-party "VPN provider" does.

  • A Russian translation of this article can be found here, contributed by Timur Demin.
  • A Turkish translation can be found here, contributed by agyild.
  • There's also this article about VPN services, which is honestly better written (and has more cat pictures!) than my article.