I hereby claim:
- I am alistairtweed on github.
- I am alistairtweed (https://keybase.io/alistairtweed) on keybase.
- I have a public key ASB84mvFmEMo3bf8aLdX-0VrcFHibp_XR1KB9fJV9ZFsHAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
data = File.readlines('./input/2.txt').map(&:strip).map do |line| | |
range, character, string = line.split /:? / | |
[range.split('-').map(&:to_i), character, string] | |
end | |
# Part 1 | |
valid = data.select do |range, character, string| | |
string.count(character).between?(*range) | |
end |
--require spec_helper |
[Unit] | |
Description=<description> | |
[Service] | |
Type=<type:forking,oneshot...> | |
User=<user> | |
WorkingDirectory=<absolute path to working directory> | |
Environment=<environment variable> | |
ExecStart=/bin/bash <script to run on start> | |
ExecStop=/bin/bash <script to run on stop> |
doctype html | |
html | |
head | |
meta charset="UTF-8" | |
meta name="description" content="" | |
meta name="keywords" content="" | |
meta name="viewport" content="width=device-width, initial-scale=1.0" | |
title | |
= stylesheet_link_tag "application" | |
= javascript_include_tag "application" |
= form_for @task, remote: true do |f| | |
- if @task.errors.any? | |
.errors | |
p Please correct the following errors: | |
ul | |
- @task.errors.full_messages.each do |message| | |
li = message | |
.field | |
= f.label :name |
div id="resource_#{resource.id}"= resource.name |
class ApplicationController < ActionController::Base | |
def remote_link | |
respond_to do |format| | |
format.js | |
end | |
end | |
end |
class ResourcesController < ApplicationController | |
before_action :set_resource, only: [:show, :edit, :update, :destroy] | |
def index | |
@resources = Resource.all | |
end | |
def show | |
end |