Skip to content

Instantly share code, notes, and snippets.

View lukemorton's full-sized avatar

Luke Morton lukemorton

View GitHub Profile
(ns big-time.ui.clock
(:require [quiescent.core :as q]
[quiescent.dom :as dom]
[clojure.string :as string]
[big-time.ui.app :as app]))
(q/defcomponent Clock
:name "Clock"
:css {:clock {:font-size "3em"}
box: nodesource/trusty
dev:
steps:
- npm-install
- internal/watch:
code: node index.js
reload: true
box: ruby
services:
- id: mariadb
env:
MYSQL_ROOT_PASSWORD: mypassword
dev:
steps:
- bundle-install
@lukemorton
lukemorton / example.cljs
Created September 18, 2015 14:00
core.async versus es7 await/async
(defn async-get [url]
(let [c (channel)]
(ajax/get url {:when-done #(>!! c %)})
c))
(defn sorted-user-repos [user]
(sort #(compare ((%1 :stars) (%2 :stars))) (user :repos)))
(defn most-popular-repo [username]
(let [user (go (<! (async-get "/users.json" {:username username})))
def hash_to_csv(hash)
csv = hash.map { |k, v| "#{k},#{v}" }.join("\n")
File.open('hash.csv', 'w') { |f| f.write(csv) }
end
# Usage:
#
# if FeatureToggle[:my_feature].enabled?
# something_with_new_feature
# end
#
# if FeatureToggle[:my_feature].disabled?
# something_without_new_feature
# end
#
@lukemorton
lukemorton / .gitconfig
Created July 20, 2015 10:26
Aliases for git
[alias]
st = status -sb
co = checkout
cp = cherry-pick
ci = commit
br = branch
sub = submodule
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
undo = reset HEAD^

Knowledge

  • Always have a launchable idea completed in the first sprint
  • Ensure external dependencies run ahead of time or at least ensure the idea works without them
  • 100% time committed to project from client staff
  • It's always best for small agile teams to have generalists rather than specialists, look for clients with these already
  • Always have a trial sprint that produces a prototype
class AnagramGrouper
def group
groups_larger_than_one(group_words(import('wordlist.txt')))
end
def group_words(words)
words.reduce({}) do |word_hash, word|
word = sanitize(word)
sorted = sort_word(word)
# Using instance method
#
class AnagramGrouper
def group(words)
# logic to group anagrams
end
end
AnagramGrouper.new.group(%w(word another bob))