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
require "socket" | |
def detect_port! | |
hostname = Snowpacker.config.hostname || "localhost" | |
port = Snowpacker.config.port || 4035 | |
server = TCPServer.new(hostname, port) | |
server.close | |
rescue Errno::EADDRINUSE | |
puts "#{port} is currently being used" | |
exit! |
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
name: Lucky Build and Spec CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build: |
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
def mount(component, *args, **named) | |
component.new(*args, **named).render do |*yield_args| | |
yield *yield_args | |
end | |
end | |
class Component | |
def initialize(@name : String) | |
end | |
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
name: rspec | |
on: | |
pull_request: | |
branches: | |
- "master" | |
push: | |
branches: | |
- "master" |
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
record Bytea, bytes : Bytes | |
struct Bytea | |
def self.adapter | |
Lucky | |
end | |
def blank? | |
@bytes.size == 0 | |
end |
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
<template> | |
<div> | |
<label v-if="label" class="form-label" :for="`date-input-${_uid}`">{{ label }}:</label> | |
<input v-bind="$attrs" class="form-input" :id="`date-input-${_uid}`" :class="{ error: error }" type="text" ref="input" :value="value" @change="change" @keyup="change"> | |
<div v-if="error" class="form-error">{{ error }}</div> | |
</div> | |
</template> | |
<script> | |
import pikaday from 'pikaday' |
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
require "http/client" | |
require "openssl" | |
module NotPwnedValidation | |
def validate_not_in_hibp | |
password.value.try do |value| | |
hash = get_sha1_hash(value).upcase | |
first_five = hash[0...5] | |
response = HTTP::Client.get("https://api.pwnedpasswords.com/range/" + first_five) | |
hashes = response.body.split("\r\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
import { Application } from 'stimulus' | |
import PasswordController from './controllers/password_controller' | |
const application = Application.start() | |
application.register("password", PasswordController) |
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
details summary { | |
cursor: pointer; | |
outline: none !important; | |
display: inline-block; | |
padding: 8px 12px; | |
padding-top: 10px; | |
border-radius: 4px; | |
overflow: hidden; | |
background: #F09825; | |
color: white; |
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 Candidates::Searches::Show < BrowserAction | |
get "/candidates/search" do | |
CandidateSearchForm.new(params).submit do |form, candidates| | |
render Candidates::IndexPage, search_form: form, candidates: candidates | |
end | |
end | |
end | |
class CandidateSearchForm < Avram::VirtualForm | |
virtual query : String |
NewerOlder