Skip to content

Instantly share code, notes, and snippets.

View nelsonblaha's full-sized avatar

Ben Nelson nelsonblaha

  • Wieck
  • Dallas, TX
View GitHub Profile
@nelsonblaha
nelsonblaha / wetness.yaml
Created August 18, 2021 20:16
Home Assistant Automations to update input_number.lawn_wetness
- id: '1511485012754'
alias: Update Lawn Wetness Rain
trigger:
- platform: state
entity_id: sensor.openweathermap_rain
- platform: state
entity_id: sensor.openweathermap_forecast_precipitation
condition: []
action:
- data_template:
alias meow="say 'meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwwwmeowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwwwmeowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowwww meow meowwwwwwww meoww meowwww meowwww meowwwwwww meowww meow meowww
We go eastward to realize history and study the works of art and literature, retracing the steps of the race; we go westward as into the future, with a spirit of enterprise and adventure. The Atlantic is a Lethean stream, in our passage over which we have had an opportunity to forget the Old World and its institutions. If we do not succeed this time, there is perhaps one more chance for the race left before it arrives on the banks of the Styx; and that is in the Lethe of the Pacific, which is three times as wide.
I know not how significant it is, or how far it is an evidence of singularity, that an individual should thus consent in his pettiest walk with the general movement of the race; but I know that something akin to the migratory instinct in birds and quadrupeds--which, in some instances, is known to have affected the squirrel tribe, impelling them to a general and mysterious movement, in which they were seen, say some, crossing the broadest rivers, each on its particular chip, with its tail raised for
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
<script>
$(document).ready(function(){
var appendages = ["right foot", "left foot", "right hand", "left hand",
"right foot", "left foot", "right hand", "left hand",
"right foot", "left foot", "right hand", "left hand",
"right foot", "left foot", "right hand", "left hand",
"right foot", "left foot", "right hand", "left hand",
@nelsonblaha
nelsonblaha / gist:78bfde3236a41b055939
Last active August 29, 2015 14:15
Change algorithm
object coins {
val usa = Seq(.01, .05, .10, .25)
val euro = Seq(.01, .02, .05, .10, .20, .50, 1, 2)
}
def cents(coin: Double) = (coin * 100).toInt
def makeChange(algorithm: (Double, Seq[Double]) => Map[Double, Int],
denominations: Seq[Double],
amount: Double) = algorithm(amount, denominations).values.sum
A man is walking along and he sees a little girl looking over the edge of a cliff, crying.
"Why are you crying?" asked the man
"My parents were in that car" sobbed the little girl, pointing down at a fiery wreck at the bottom of the cliff.
"What sort of car is that?" asked the man who unfortunately suffered from Asperger's syndrome and didn't understand the emotional impact of the situation.
@nelsonblaha
nelsonblaha / resourcePattern.scala
Last active August 29, 2015 14:07
Pattern for sorting ways to get a resource "UserFavorites"
def index = Action.async { implicit request =>
ChanneledPresenter(context) flatMap { presenter =>
// alternatives for resource fetching, which may or may not be available
val getAccountFavorites = ???
val createAccountFavorites = ???
val getSessionFavorites = ???
val createSessionFavorites = ???
Seq(getAccountFavorites,
@nelsonblaha
nelsonblaha / gist:5400086
Created April 16, 2013 22:11
Problem with Coursera Scala video 3.1 code
package objsets
abstract class IntSet {
def incl(x:Int): IntSet
def contains(x:Int): Boolean
}
class Empty extends IntSet {
def contains(x: Int): Boolean = false
@nelsonblaha
nelsonblaha / rails-composer.sh
Created February 6, 2013 02:38
Bash script for rails-composer
#!/usr/bin/env bash
rails new $1 -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb
@nelsonblaha
nelsonblaha / debug.sublime-snippet
Last active December 12, 2015 03:09
debug snippet
<!-- Very fast way to puts something both evaluated and unevaluated without repetition -->
<snippet>
<content><![CDATA[
puts 'debug $1: '+$1.to_s
]]></content>
<tabTrigger>debug</tabTrigger>
</snippet>