Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View r00k's full-sized avatar
💭
Working on Tuple (https://tuple.app)

Ben Orenstein r00k

💭
Working on Tuple (https://tuple.app)
View GitHub Profile
-- I've successfully written a random generator for Circles.
randomCircle : Random.Generator Circle
randomCircle =
Random.map4
Circle
(Random.pair (Random.float -200 200) (Random.float -200 200))
(Random.float minimumRadiusLength maximumRadiusLength)
randomColor
(Random.float 0 maximumAlpha)
port module Main exposing (..)
import Collage
import Color
import Debug
import Element
import Html exposing (..)
import Html.App
import Html.Attributes exposing (..)
import Html.Events exposing (..)
-- TYPE MISMATCH -------------------------------------------------- src/Main.elm
The type annotation for `randomCircle` does not match its definition.
38| randomCircle : Random.Generator Circle
^^^^^^^^^^^^^^^^^^^^^^^
The type annotation is saying:
Random.Generator { center : ( Int, Int ) }
@r00k
r00k / Main.elm
Last active October 26, 2016 22:56
-- See this document for more information on making Pong:
-- http://elm-lang.org/blog/pong
module Main exposing (..)
import Color exposing (..)
import Collage exposing (..)
import Debug
import Element exposing (..)
module Util.CustomEvent (onSubmit) where
import Html exposing (..)
import Html.Events exposing (onWithOptions, defaultOptions)
import Json.Decode exposing (value)
onSubmit : Signal.Address a -> a -> Attribute
onSubmit addr msg =
onWithOptions
"submit"
@r00k
r00k / query.rb
Created February 21, 2016 04:12
Not so hard after all.
def self.popular_this_week
Podcast.
joins(:downloads).
select("podcasts.*, COUNT(podcast_id) as download_count").
where("downloads.created_at >= ?", 1.week.ago.utc).
group("podcasts.id").
order("download_count DESC")
end
@r00k
r00k / gist:1a231ed20c3cdff6aaaa
Last active February 19, 2016 17:58
Possible Course Names

Vim Course Name Candidates

Which of these names most make you want to take a live Vim class with Chris Toomey and me?

  • Breaking out of Beginner Vim
  • Vim: Beyond the Basics
  • Become a Daily Vimmer
  • Write Code Faster: Level Up Your Vim
  • Vim for Rails Developers
  • Reaching Intermediate Vim
@r00k
r00k / gist:36677951462ffd01d98c
Last active December 9, 2016 15:40
Ben Orenstein's Weekly Review Checklist
# Checklist for Weekly Review
## Sweep
[ ] Process work email inbox
[ ] Process personal email inbox
[ ] Review calendar, +/- 2 weeks.
[ ] Review [this trigger list](http://gettingthingsdone.com/wp-content/uploads/2014/10/Mind_Sweep_Trigger_List.pdf)
## Process
commit 81a9375d4ecbd37ca9da7efaebbffa8cf150d6f6
Author: Ben Orenstein <ben.orenstein@gmail.com>
Date: Wed Jul 22 12:02:43 2015 -0400
code review ideas
diff --git a/app.rb b/app.rb
index 93bac6c..c9443f6 100644
--- a/app.rb
+++ b/app.rb
@r00k
r00k / q1.md
Last active January 29, 2017 03:00
Quizzy Question 1

Question 1

What object-oriented programming advice is this code violating?

def check_for_overheating(system_monitor)
  if system_monitor.temperature > 100
    system_monitor.sound_alarms
  end
end