Skip to content

Instantly share code, notes, and snippets.

View artfuldev's full-sized avatar
☺️
Having fun

Sudarsan Balaji artfuldev

☺️
Having fun
View GitHub Profile
@artfuldev
artfuldev / st3p.md
Created January 2, 2024 20:30
Simple Tic-Tac-Toe Protocol

ST3P

Simple Tic-Tac-Toe Protocol

Overview

ST3P is a text-based protocol facilitating communication between Tic-Tac-Toe engines and UI/coordinator processes.

The protocol operates over standard input and output, supporting standalone

@artfuldev
artfuldev / t3en.md
Created January 2, 2024 20:27
Tic-Tac-Toe Extensible Notation

T3EN

Tic-Tac-Toe Extensible Notation

Overview

T3EN is a notation system designed to represent the state of a Tic-Tac-Toe board for various board configurations, including standard and non-standard shapes.

@artfuldev
artfuldev / resolve_coreference.py
Last active June 3, 2022 16:19 — forked from karthikavijayanexpts/corefResolve.py
Coreference resolution using coreferee and spacy
import spacy
import coreferee
def flatten(list_of_lists):
flat_list = [];
for item in list_of_lists:
if type(item) == list:
for sub_item in item:
flat_list.append(sub_item)
else:
@artfuldev
artfuldev / clojure-deftype-scaffolding.clj
Last active May 29, 2022 13:18 — forked from semperos/clojure-deftype-scaffolding.clj
Clojure Scaffolding for deftype (Christophe Grand) - Show which methods a class implements and for which interfaces
;; Big thanks to Christophe Grand - https://groups.google.com/d/msg/clojure/L1GiqSyQVVg/m-WJogaqU8sJ
(defn scaffold [iface]
(doseq [[iface methods] (->> iface .getMethods
(map #(vector (.getName (.getDeclaringClass %))
(symbol (.getName %))
(count (.getParameterTypes %))))
(group-by first))]
(println (str " " iface))
(doseq [[_ name argcount] methods]
(println
@artfuldev
artfuldev / gh_manual_merge_pr.txt
Last active January 24, 2022 18:44 — forked from notmandatory/gh_manual_merge_pr.txt
Manual merge PRs to preserve commit signatures
# from target repo clone directory
# make sure you're in sync with origin
git checkout master
git fetch --all
git pull origin master
# fetch PR to FETCH_HEAD
git fetch origin pull/<PR#>/head
# double check the changes
git diff master FETCH_HEAD
# merge to master and push to origin (github)
{
"scripts": {
"test": "cross-env TS_NODE_COMPILER_OPTIONS='{ \"module\": \"commonjs\" }' mocha -r ts-node/register -r ignore-styles -r jsdom-global/register src/**/*.spec.ts"
}
}
$ npm install cross-env --save-dev
{
"compilerOptions": {
"outDir": "./dist/",
"target": "es5",
"module": "esnext",
"moduleResolution": "node",
"sourceMap": true,
"experimentalDecorators": true,
"lib": [ "dom", "es6", "es5" ]
},
{
"scripts": {
"test": "mocha -r ts-node/register -r ignore-styles -r jsdom-global/register src/**/*.spec.ts"
}
}
$ npm install jsdom jsdom-global --save-dev