Skip to content

Instantly share code, notes, and snippets.

Dean Radcliffe deanius

Block or report user

Report or block deanius

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

Get started with the deanhtml5 generator

  • Install node v 10 or greater (Tried NVM ?? )
  • Install NPM, run npm install -g yeoman
  • Run npm install -g generator-deanhtml5
  • Make a directory and in it run yo deanhtml5
  • Give the app a title, and answer any other prompts
  • Begin to fiddle with the app and tests

You now have an HTML5 app, which needs no back end process to run it but:

deanius /
Last active Aug 29, 2015
Keep Systems Up to date
xcode-select --install
deanius /
Last active Aug 29, 2015
A cup of morning Comment Sense
# let your comment-sense dir be PWD
set -e # abort on error
echo "Good morning. Updating projects..."
git checkout master
git pull
bundle install
rake db:migrate
RAILS_ENV=test rake db:migrate
echo "Yay all is good"
deanius / bracket_balancer.rb
Last active Aug 29, 2015
4clojure #177 - Bracket Balancer
View bracket_balancer.rb
# Solution by Dean Radcliffe to 4clojure problem #177
# Disclaimer: not production-ready
# Strategy: Build a tree from parens. Return tree as truthy value, else nil
# TODO clojurify this
require 'ostruct' #convenient hash-like data structure
require 'pp' #pretty printer (optional)
def closer? char
deanius / update
Last active Aug 29, 2015
Updating Gems checklist
View update
  • Git pull and all tests pass
  • Run bundle outdated > gem_outdated

For a given gem to update:

  • Do a dependency report gem dependency -R GEMNAME

  • Delete the version specifier in Gemfile

  • Run bundle install

  • Commit Gemfile and Gemfile.lock

  • Optionally do gem cleanup on your system

View k-sets.rb
def ksets s=[1,2,3], k=s.size
s.inject([[]]) do |acc, v|
acc +{|exist| [v] + exist}{|s| s.length == k}
deanius / kcomb.clj
Created Apr 18, 2014
K-sets clojure explorations
View kcomb.clj
;; Anything you type in here will be executed
;; immediately with the results shown on the
;; right.
(defn kcomb [k vect]
(= k 0) '(())
(empty? vect) '()
:else (concat (map
#(cons (first vect) %)
deanius /
Created Apr 27, 2014
Alternate requirejs syntax
# TL;DR: Instead of a verb-oriented 'define' function with anonymous arguments, a
# 'descriptive' function with named arguments
module deps:[‘a’, ‘b’], factory:(a, b)->
# compare with
define ['a', 'b'], (a, b) ->
# module 'BlahBlah', deps:[‘a’, ‘b’], factory:(a, b)->
deanius / min-triangle-path.clj
Last active Aug 29, 2015
4clojure problem 79
View min-triangle-path.clj
; thanks to @eigenhombre i was reminded that we can only take "plinko" paths
; also props for introducing me to letfn
; this is what led to the insight that a vector becomes 2 possible vectors
; much like the branching universe theory, and we must mapcat those as we go !
; Key insight
; You branch in predictable way like the game of PLINKO on The Price is Right :)
; Eg at each step, the branches multiply thusly:
; ([0 0]) becomes ([0 0 0] [0 0 1])
View -
diff --git a/test/spec/ b/test/spec/
index c8cd535..fac783e 100644
--- a/test/spec/
+++ b/test/spec/
@@ -561,9 +561,11 @@ describe 'RawHtml', ->
describe 'rxt', ->
- it 'should take as contents (arrays of) strings, elements, RawHtml, or $', ->
+ it 'should take as contents (arrays of) numbers, strings, elements, RawHtml, $ or null', ->
You can’t perform that action at this time.