This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: | |
dot -Tpng -o building-issue-workflow.png building-issue-workflow.dot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AriaDownloadStrategy < CurlDownloadStrategy | |
def aria_args(options = {}) | |
aria = Pathname.new ENV["HOMEBREW_ARIA"] | |
aria = Pathname.new "/usr/local/bin/aria2c" unless aria.exist? | |
raise "#{aria} is not executable" unless aria.exist? && aria.executable? | |
args = [ | |
aria.to_s, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#### | |
# List available updates from Homebrew (OS X) | |
### | |
exit_with_error() { | |
echo "err | color=red"; | |
exit 1; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AbstractionsContractBase < ContractBase | |
include AbstractionsContract::Clauses::CodeOfConduct | |
include AbstractionsContract::Clauses::LiabilityDisclaimer | |
end | |
class AbstractionsBronzeContract < AbstractionsContractBase | |
include AbstractionsContract::Clauses::PaidSponsorship | |
min_payment 10_000.USD | |
include AbstractionsContract::Clauses::Perks::WebsiteLogo | |
include AbstractionsContract::Clauses::Perks::Table |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BenchmarkStringAccumulation { | |
def timeSInterpolation(reps: Int) = repeat(reps) { | |
strings.foldLeft("") { (acc, string) => s"$acc$string" } | |
} | |
def timeFInterpolation(reps: Int) = repeat(reps) { | |
strings.foldLeft("") { (acc, string) => f"$acc%s$string%s" } | |
} | |
def timeConcat(reps: Int) = repeat(reps) { | |
strings.foldLeft("") { (acc, string) => acc + string } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Todd Kaufman shared this: | |
# https://codeandsupply.slack.com/archives/chat/p1460305918002336 | |
# > there's a surprisingly large number of 8-letter word pairs which differ only in the second letter (related to npr puzzler) | |
# > should be `grep '^[a-z].....[a-z].$'` because linux has a bunch of apostrophe-s's which should not be there. | |
# > OTOH, the OSX version (Webster's 2nd) doesn't even have plurals, though it does generally have "more words" (but fewer lines). Did find the answer on linux though... but downloading a copy of wordnet to have on hand | |
grep '^[a-z].......$' /usr/share/dict/words | perl -pe '$w=substr($_,0,1) . substr($_,2,6); print "$w\t";' | sort | perl -ne 'chomp; ($k,$w)=split(/\t/); print "$w $wl\n" if ($k eq $kl); ($wl,$kl)=($w,$k);' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class QuantityCheck[T](thing: Seq[T]) | |
case class JustRight[T](thing: Seq[T]) extends QuantityCheck(thing) | |
case class TooFew[T](thing: Seq[T]) extends QuantityCheck(thing) | |
case class TooMany[T](thing: Seq[T]) extends QuantityCheck(thing) | |
object QuantityCheck { | |
def apply[T](number: Int)(seqLike: Seq[T]): QuantityCheck[T] = { | |
seqLike.lengthCompare(number) match { | |
case x if x < 0 => TooFew(seqLike) | |
case x if x == 0 => JustRight(seqLike) | |
case x if x > 0 => TooMany(seqLike) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Network Working Group Thomas Brownback | |
Request for Comments: xxxx Independent Researcher | |
Category: Experimental Month YYYY | |
Password Negotiation for Password Managers | |
Abstract | |
This document proposes a protocol that would enable a password | |
manager (PM) to register or change a password with online |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NodeId(val id: Int) | |
case class DocumentId(override val id: Int) extends NodeId(id) | |
case class ContainerId(override val id: Int) extends NodeId(id) | |
case class UserId(override val id: Int) extends NodeId(id) | |
// how can I get DocumentId, ContainerId, and UserId to be a NodeId and still extend AnyVal? | |
// this seems to work: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# warning: this was never tested. | |
# license: cc0 | |
require 'win32/registry' | |
module SteamR; module Registry | |
STEAM_HKEY_ROOT = 'SOFTWARE\Valve\Steam' | |
HKEYS = { |