Skip to content

Instantly share code, notes, and snippets.

View cyberoctopi's full-sized avatar
😣
Tinkering

No Say cyberoctopi

😣
Tinkering
  • No where
View GitHub Profile

Rich Hickey on becoming a better developer

Rich Hickey • 3 years ago

Sorry, I have to disagree with the entire premise here.

A wide variety of experiences might lead to well-roundedness, but not to greatness, nor even goodness. By constantly switching from one thing to another you are always reaching above your comfort zone, yes, but doing so by resetting your skill and knowledge level to zero.

Mastery comes from a combination of at least several of the following:

@apbendi
apbendi / core_functions_in_depth.clj
Last active October 22, 2021 02:16
Solutions: Clojure for the Brave and True (braveclojure.com)
; In Clojure for the Brave and True (braveclojuure.com),
; at the end of the chapter "Core Functions in Depth", the author
; prevents several challanges to build on top of some sample code
; he has provided
; This code is provided by the author:
;; In ns below, notice that "gen-class" was removed
(ns fwpd.core
;; We haven't gone over require but we will.
@limist
limist / gist:5450982
Last active June 28, 2018 05:52
Web crawler example from the book "Clojure Programming"; the book's code has been modified with the imports (missing from book) needed to compile correctly, BUT the results of crawling look wrong, it seems only one URL is processed per agent(s), and then the agent(s) stops for the rest of the runtime.
(require '[net.cgrand.enlive-html :as enlive]) ; This line requires enlive 1.0.0
(use '[clojure.string :only (lower-case)])
(import '(java.net URL MalformedURLException))
;; The two imports below were not in the book, but essential for
;; subsequent code to work:
(use '[clojure.java.io :only (as-url)])
(import [java.util.concurrent BlockingQueue LinkedBlockingQueue])
;; Page 218:
(defn- links-from [base-url html]
@christophercliff
christophercliff / Makefile
Created December 14, 2012 00:19
Makefile for deploying a Wintersmith static site to Github Pages without exposing the source (assumes you're using the default build directory).
deploy:
rm -rf ./build
wintersmith build
cd ./build && \
git init . && \
git add . && \
git commit -m "Deploy"; \
git push "git@github.com:{YOUR NAME}/{YOUR REPO}.git" master:gh-pages --force && \
rm -rf .git
@stew
stew / curry.scala
Created August 31, 2012 02:53
example of currying
// you have items
case class Item(name: String, price: Double)
// their prices can be adjusted. To adjust a price, pass a function
// which takes the old price, and gives a new price
def adjustPrice(i: Item, discountFunction: Double => Double) = {
// return a new copy with the price changed
i.copy(price = discountFunction(i.price))
}
@mattbrictson
mattbrictson / Gemfile
Created January 26, 2012 23:02
Install Compass in Rails 3.1/3.2
group :assets do
gem 'compass-rails','~> 1.0.0.rc.2'
gem 'compass-colors'
gem 'sassy-buttons'
gem 'sass-rails', '~> 3.2.3'
# non-compass gems omitted for brevity
end
@pachacamac
pachacamac / google_speech_recognition.rb
Created December 11, 2011 10:52
google speech recognition with ruby
require 'rest_client'
require 'json'
a = `sox -d --norm -t .flac - silence -l 1 0 1% 1 6.0 1% rate 16k`
#a = `arecord -q -d 3 -c 1 -f S16_LE -r 22050 -t wav | flac - -f --totally-silent -o-`
r = RestClient.post 'https://www.google.com/speech-api/v1/recognize?lang=en-US', a,
:content_type => 'audio/x-flac; rate=16000'
if j = JSON.parse(r)
(p j; `espeak 'you said: #{j['hypotheses'].first['utterance']}'`)
end
@slothbear
slothbear / gist:1384738
Created November 22, 2011 02:41
rails console test of belongs_to association
ruby :032 > site = Site.create(:name => "Boston")
SQL (0.5ms) INSERT INTO "sites" ("created_at", "name", "updated_at") VALUES (?, ?, ?) [["created_at", Tue, 22 Nov 2011 02:28:57 UTC +00:00], ["name", "Boston"], ["updated_at", Tue, 22 Nov 2011 02:28:57 UTC +00:00]]
=> #<Site id: 5, name: "Boston", created_at: "2011-11-22 02:28:57", updated_at: "2011-11-22 02:28:57">
ruby :033 > device = Device.create(:name => "hackatron")
SQL (0.6ms) INSERT INTO "devices" ("created_at", "name", "site_id", "updated_at") VALUES (?, ?, ?, ?) [["created_at", Tue, 22 Nov 2011 02:29:13 UTC +00:00], ["name", "hackatron"], ["site_id", nil], ["updated_at", Tue, 22 Nov 2011 02:29:13 UTC +00:00]]
=> #<Device id: 5, name: "hackatron", created_at: "2011-11-22 02:29:13", updated_at: "2011-11-22 02:29:13", site_id: nil>
ruby :034 > site.devices << device
(0.4ms) UPDATE "devices" SET "site_id" = 5, "updated_at" = '2011-11-22 02:29:39.327808' WHERE "devices"."id" = 5
Device Load (0.2ms) SELECT "devices".* FROM "devices" WHER
@schleg
schleg / 01. Gemfile
Created May 26, 2011 17:26
Setup for Devise + Omniauth
gem 'pg'
group :development do
gem 'ruby-debug'
end
gem 'rake', '~> 0.8.7'
gem 'devise'
gem 'oa-oauth', :require => 'omniauth/oauth'
gem 'omniauth'
gem 'haml'
gem 'dynamic_form'