Skip to content

Instantly share code, notes, and snippets.

View adrianmcli's full-sized avatar
:shipit:
What's happening?

Adrian Li adrianmcli

:shipit:
What's happening?
View GitHub Profile
@adrianmcli
adrianmcli / PARTNER_CRITERIA.md
Last active January 20, 2024 17:57
A list of personality criteria that future partners must have.

Partner Personality Criteria

All partners should have, to some degree, substantially all of the following personality traits:

  1. A partner should be a self-starter. He should, without prompting, take (or offer to take) initiative and pick up slack for work that may not fall into his own designated domain.

  2. A partner should be conscientious, thorough, and judiciously meticulous. In the context of his responsibilities, he should be expected to thoroughly examine all available options in the world and be able to justify any action or in-action in regards to his responsibilities.

    • Being the expert. He should be able to communicate an analysis of the most up-to-date state of the world, under his designated domain, such that he can give the team a broad but nevertheless exhaustive overview of his domain.
  • Offering alternatives. If an initial analysis or the conclusion of such analysis proves to be difficult for meeting our team's needs, he should have prepared an analysis of alterna
@adrianmcli
adrianmcli / DAN_MARTEL.md
Created May 28, 2016 06:14
Brief research on the career of Dan Martell.

Dan Martell

A New Brunswick native, Canadian Dan Martell discovered a book on Java programming while he was in rehab at the age of 18. According to him, this was his life’s turning point. Not long after that, he started a vacation rental (or cottage booking) site called Maritime Vacations.

Unfortunately, this didn’t work out for him because he eventually got pushed out by a larger, less niche, cottage-booking site. He was focused on the small region of Cummins in Eastern Canada and as a result, his growth was limited. This is an example of how nicheing down can hurt you.

Sometime after that, he started a web hosting company called NBHost. The biggest lesson he learned was “don’t start a web hosting company”. There’s just way too much to worry about, servers, uptime, etc.

Eventually, he would acquire a role as a Senior Web Developer in a large tech consulting firm in the year 2000. It’s not clear how the timeline of his two previous ventures coincide with his work history, but nevertheless, he worked the

@adrianmcli
adrianmcli / dota2.json
Created July 21, 2016 11:05
example output from api
{
"result": {
"status": 1,
"matches": [
{
"players": [
{
"account_id": 4294967295,
"player_slot": 0,
"hero_id": 11,
@adrianmcli
adrianmcli / test_query.js
Created July 22, 2016 11:04
test rethinkdb query
const query = () => r.db('dataDb')
.table('trackedUsers')
.filter({ appId })
.concatMap(user => r.db('dataDb').table('alive')
.getAll(user('userId'), { index: 'userId' })
.do(
result => r.branch(
result.count().eq(0),
[{ left: user }],
result.map(alive => ({ left: user, right: alive }))
@adrianmcli
adrianmcli / compass-reskin.css
Last active November 19, 2016 18:28
A first attempt at reskinning Compass
.activity {
background: white;
transition: all 200ms;
}
.activity .icon {
color: #FF9900;
}
.activity .name {
@mixin for-phone-only {
@media (max-width: 599px) { @content; }
}
@mixin for-tablet-portrait-up {
@media (min-width: 600px) { @content; }
}
@mixin for-tablet-landscape-up {
@media (min-width: 900px) { @content; }
}
@mixin for-desktop-up {
@adrianmcli
adrianmcli / dead-simple-react-autosuggest-example.js
Created December 13, 2016 08:21
Dead simple react-autosuggest component.
import React from 'react';
import Autosuggest from 'react-autosuggest';
// This function returns the suggestions, given the current input value.
function getSuggestions(value) {
// I decided to always return the same suggestions
// just to keep things simple.
return [
{ name: 'a' },
{ name: 'aa' },
@adrianmcli
adrianmcli / react-naive-bayes.js
Last active December 29, 2016 10:45
Naive Bayes classifier basic demo with React and Natural
import React from 'react';
import natural from 'natural';
class App extends React.Component {
constructor() {
super();
// Create a classifier instance
const classifier = new natural.BayesClassifier();
// Train the classifier
@adrianmcli
adrianmcli / IsTyping.js
Created December 31, 2016 02:38
A simple React component to show how to add a time-delayed typing indicator for a textarea.
import React, { Component } from 'react';
class IsTyping extends Component {
constructor() {
super();
this.state = {
typing: false,
};
this.timeout = null;
this.onChange = this.onChange.bind(this);
@adrianmcli
adrianmcli / event-loop.js
Created January 6, 2017 00:42
A quiz on the Javascript event loop from Daniel Parker's JavaScript with Promises
var async = true;
var xhr = new XMLHttpRequest();
xhr.open('get', 'data.json', async);
xhr.send();
// Create a three second delay (don't do this in real life)
var timestamp = Date.now() + 3000;
while (Date.now() < timestamp);
// Now that three seconds have passed,