Skip to content

Instantly share code, notes, and snippets.

View ddugovic's full-sized avatar
💭
I may be slow to respond.

Daniel Dugovic ddugovic

💭
I may be slow to respond.
View GitHub Profile
@ornicar
ornicar / browser-ndjson-stream-reader.js
Last active November 9, 2023 19:02
Read a ND-JSON stream from the browser or from nodejs
/* FOR THE BROWSER
Utility function to read a ND-JSON HTTP stream.
`processLine` is a function taking a JSON object. It will be called with each element of the stream.
`response` is the result of a `fetch` request.
See usage example in the next file.
*/
const readStream = processLine => response => {
const stream = response.body.getReader();
const matcher = /\r?\n/;
@ornicar
ornicar / How to ask technical questions.md
Last active October 1, 2021 13:08
How to ask technical questions

How to ask technical questions

Doing it right will save everyone a lot of time, and will motivate others to help you.

  1. Try to find the answer by yourself, using documentation and search engines

If you can't find the answer, here's how to ask other people. Following these steps is the best way to quickly get quality answers.

@Marken-Foo
Marken-Foo / KIF_standard.md
Created December 19, 2020 14:18
Shogi KIF file standard

Kifu file KIF format

This document is a translation of the original Japanese text at http://kakinoki.o.oo7.jp/kif_format.html on 2020-11-11 by Marken Foo.

  • 2020/11/11 translated to English
  • 2020/11/25 added translated tsumeshogi sample headers

Summary

The KIF file format used by programs like Kakinoki Shogi and "Kifu for Series" is a text file format described below.

<html>
<head>
<style>
body {
font-family: 'Noto Sans';
overflow: hidden;
}
input {
width: 100%;
}
@DerEnderKeks
DerEnderKeks / WebhookTutorial.md
Last active December 4, 2023 20:28
Simple Webhook Tutorial (Twitter -> Discord using IFTTT)

Simple Webhook Tutorial

In this tutorial, I will be explaining how to set up a simple webhook to relay your tweets to a Discord channel.

Step 1 - Register on IFTTT

  1. Go to https://ifttt.com/ and create an account (if you don't already have one).

Step 2 - Make a Discord Webhook

  1. Find the Discord channel in which you would like to send Tweets.

  2. In the settings for that channel, find the Webhooks option and create a new webhook.

@WOnder93
WOnder93 / check_benches.sh
Last active March 29, 2018 12:37
Stockfish - scripts for automated bench comparison
#!/bin/bash
if [ $# -eq 0 ]; then
echo "usage: [SYZYGY_PATH='...'] [BENCH_ARGS='...'] $0 COMMIT..."
echo
echo " Prints bench for each COMMIT. Output is stored in 'bench-COMMIT.log'."
echo
echo " Command-line arguments:"
echo " COMMIT... list of commits to check"
echo
@mdstoy
mdstoy / get-kifu
Created January 12, 2018 15:23
(Lazy) One liner that create csa file from shogi wars kifu url
curl <kifu-url> | grep receiveMove | sed -E 's/( +receiveMove\("|[A-Z_]+"\);|,L[0-9]+)//g' | sed 's/^/PI\t+\t/' | sed 's/\t/\n/g' > [output-file]
@andreij
andreij / pubapi_docs.html
Last active May 10, 2022 15:59 — forked from BiviaBen/pubapi_docs.html
Chess.com Published-Data API
<p>The PubAPI is a read-only REST API that responds with JSON-LD data. Our goal is to re-package all currently public data from the website and make it available via the PubAPI. "Public Data" is information available to people who are not logged in, such as player data, game data, and club/tournament information. This excludes private information that is restricted to the logged in user, such as game chat and conditional moves.</p>
<p>This is read-only data. You cannot send game-moves or other commands to Chess.com from this system. If you wish to send commands, you will be interested in the Interactive API releasing later this year.</p>
<p>To use the PubAPI:</p>
<ol>
<li>determine the data you want, and compose the URL for it based on the endpoint URL pattern</li>
<li>request that URL in your browser, program, <a href="https://www.getpostman.com/">Postman</a>, cURL, or <a href="https://en.wikipedia.org/wiki/IP_over_Avian_Carriers">pigeon</a>.</li>
<li>enjoy the JSON <img src="https://www.chess.com/bundles/we
@niklasf
niklasf / atomic.md5sums
Last active November 16, 2016 15:29
MD5SUMS of 5 piece atomic syzygy tables
5f09f78f986d440d5fda3cd28b335eb3 KBBBvK.atbw
30405c5366213d43f4acf68b10c5ca58 KBBBvK.atbz
8314a33d3042c8ab76ca365d492c7fd2 KBBNvK.atbw
996aa9ef24cadf6342e15212b8ca91a1 KBBNvK.atbz
2087b9823af4ca34e0f1692b917650e5 KBBPvK.atbw
19b934721c02787d50b471ef44e99bd7 KBBPvK.atbz
0b12a60dcd347e5db4dcb3a19a351b1f KBBvK.atbw
2cdbcd87dbd5a2e069b121d08eb68138 KBBvK.atbz
6d57f8073f620c5a4c0e33ecda89e79a KBBvKB.atbw
a382621f6953995d3948b5f45d5cf7bb KBBvKB.atbz
@beefy
beefy / chess_scrape.py
Last active December 29, 2020 03:56
Scrapes all live chess game PGNs from chess.com and concatenates the resulting files
#!/usr/bin/python
import spynner
import pyquery
import urllib
import os
# author: Nate Schultz
# contact: github.com/beefy
# created: 10/22/16