Skip to content

Instantly share code, notes, and snippets.

🍪

Darius I. Karel dikarel

🍪
Block or report user

Report or block dikarel

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@dikarel
dikarel / ml5.d.ts
Last active Jul 19, 2019
ml5.js TypeScript definitions draft
View ml5.d.ts
// Not quite there yet, but better than nothing
// TODO: JSDoc, based on website documentation
// TODO: Interface/class types for each of these ML algorithm instances
// TODO: Break this apart into multiple files for readability
// TODO: Test autocomplete in a vanilla JS project
// TODO: Test autocomplete in a TypeScript project
import { MediaElement } from "p5";
export as namespace ml5;
@dikarel
dikarel / docker-machine.md
Created Dec 10, 2016
Setting up a Docker machine for corporate environments
View docker-machine.md

Create default Docker machine on VirtualBox with custom settings

You might want to do this to allocate extra RAM and disk size for Docker (esp. when dealing with large container images)

  1. Ensure that there's not yet been a Docker machine called 'default' (docker-machine ls). If so, you should remove it (docker-machine rm default).
    In theory, you can just create a second machine with a different name. This is not recommended since VirtualBox assigns IP addresses to each machine non-deterministically every time you restart your computer, causing docker-machine to choke on TLS cert-related issues
@dikarel
dikarel / hackerrank-util.js
Created Oct 2, 2016
HackerRank utilities
View hackerrank-util.js
// Minified one-liner
var main=d=>{var l=[];return require('readline').createInterface({input:process.stdin}).on('line',i=>l.push(i)).on('close',()=>d(l))}
// Example
main(lines => {
console.log('My lines are', lines)
})
@dikarel
dikarel / hackerrank-helpers.coffee
Last active Oct 2, 2016
Helper classes for HackerRank
View hackerrank-helpers.coffee
# Reads lines from stdin and run specified function
main = (done) ->
lines = []
readline = require 'readline'
readline.createInterface input: process.stdin
.on 'line', (line) -> lines.push line
.on 'close', -> done lines
# Minified one-liner
main=(d)->l=[];require('readline').createInterface(input:process.stdin).on('line',(i)->l.push i).on('close',->d l)
You can’t perform that action at this time.