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
package main | |
import ( | |
"strconv" | |
"github.com/brutella/hc" | |
"github.com/brutella/hc/log" | |
"github.com/brutella/hc/accessory" | |
) | |
type Bridge struct { |
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
<html> | |
<head> | |
<style> | |
body { | |
counter-reset: n; | |
} | |
div:before { | |
counter-increment: n; | |
content: counter(n); | |
} |
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 Create < Trailblazer::Operation | |
include Model | |
model Workflow | |
contract do | |
property :name | |
property :description | |
collection :steps, populate_if_empty: Step do | |
property :form, populate_if_empty: lambda { |params, *| Form.find(params[:workflow][:steps][:form][:id]) } |
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/sh | |
# | |
# Lives in .git/hooks. | |
# To enable this hook, rename this file to "pre-commit". | |
# Redirect output to stderr. | |
exec 1>&2 | |
# works, but is slow. try with ack! | |
# LANG=C find . -name '*_spec.rb' | xargs egrep -q '^\s*(describe|it|context)\b.*focus' |
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 OptimalPath | |
def initialize(road_system) | |
@road_system = road_system | |
end | |
def solve | |
bestA, bestB = | |
@road_system.inject([Path.new, Path.new]) do |(pathA, pathB), section| | |
road_step(pathA, pathB, section) | |
end |