Skip to content

Instantly share code, notes, and snippets.


Ian Channing ianchanning

View GitHub Profile
ianchanning / output.txt
Created Oct 18, 2020
coc.nvim debug log
View output.txt
This file has been truncated, but you can view the full file.
11:54:54 DEBUG [transport] - request to vim: -1,nvim_get_api_info,[]
11:54:54 DEBUG [connection] - send to vim: [
ianchanning / output.txt
Created Sep 20, 2020
CocCommand showWorkspace output
View output.txt
[Trace - 12:31:46] Sending request 'initialize - (0)'.
Params: {
"processId": 26375,
"rootPath": "/home/channi16/imec/innovatrix",
"rootUri": "file:///home/channi16/imec/innovatrix",
"capabilities": {
"workspace": {
"applyEdit": true,
"workspaceEdit": {
"documentChanges": true,
ianchanning / row_toggle.js
Last active Feb 14, 2020
Pure JavaScript hierarchical table row toggling (plus older jQuery version too)
View row_toggle.js
* Hierarchical table rows object
* Pure JavaScript - but comes with a IE9+ warning
* @param {object} options tableSelector e.g. 'table'
* parentClass e.g. 'parent'
* collapsedClass e.g. 'hidden'
* childClassPrefix e.g. 'parentId'
* @type function
ianchanning /
Last active Sep 8, 2019
What are the differences between segment trees, interval trees, binary indexed trees and range trees?
ianchanning / .eslintrc.json
Last active Nov 25, 2018
A Neural Network in JavaScript. This now has it's own Github repo:
View .eslintrc.json
"env": {
"browser": true,
"es6": true
"extends": "eslint:recommended",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
ianchanning /
Last active Jun 15, 2018
Self-driving cars should replace amateur instead of professional drivers

Keybase proof

I hereby claim:

  • I am ianchanning on github.
  • I am ianchanning ( on keybase.
  • I have a public key ASB0bBCnW44BV-yA8TYmgkCqhxaDA-WYBGwTSBp9kkWGnQo

To claim this, I am signing this object:

ianchanning / ping.php
Created Jun 14, 2013
PHP Ping Packets
View ping.php
* Ping a host using an IMCP packet
* N.B. This function must be called by an administrator / root user as socket_create requires this
* @param string $host domain
* @param integer $timeout seconds
* @return mixed False | Response time milliseconds
ianchanning /
Last active Mar 12, 2018
Yet another monad explanation

tl;dr Here's a really short explanation for JavaScript, as in just the flatmap part.

map is pretty well understood in JavaScript (and I'm assuming you understand it).

So you 'just' need to make the leap to flatmap. Which is mapping something and flattening the result.

Flattening a JavaScript array is concatenating a 2D array into an array.

Longer Python example

Another attempt at explaining monads, using just Python lists and the map function. I fully accept this isn't a full explanation, but I hope it gets at the core concepts.

View datatables.json
"data": [
"name": "Tiger Nixon",
"position": "System Architect",
"salary": "$320,800",
"start_date": "2011/04/25",
"office": "Edinburgh",
"extn": "5421"