Skip to content

Instantly share code, notes, and snippets.

@eminkel
eminkel / acme.json
Last active September 25, 2023 22:11
Docker Registry with Traefik and LetsEncrypt
{}
@eminkel
eminkel / calendar.html
Created July 29, 2021 06:45
calendar-tailwind-alpinejs
<body class="antialiased sans-serif bg-gray-100">
<div x-data="app()" x-init="[initDate(), getNoOfDays()]" x-cloak>
<div class="container mx-auto px-4 py-2 md:py-24">
<!-- <div class="font-bold text-gray-800 text-xl mb-4">
Schedule Tasks
</div> -->
<div class="bg-white rounded-lg shadow overflow-hidden">
<div class="w-full">
<div class="flex flex-col items-center justify-center space-y-2">
<div
class="flex bg-purp-100 rounded-full items-center justify-center p-4"
>
<div
class="cursor-pointer h-8 w-8 bg-red-600 rounded-full hover:bg-red-500"
data-action="click->widgets--recorder#start"
data-target="widgets--recorder.recordButton"
id="start"
@eminkel
eminkel / form.html.erb
Last active September 10, 2020 02:17
StimulusJS Tag Component
<div class="mt-6">
<%= f.label :tags, class: 'form-label' %>
<div class="border border-gray-300 rounded-md flex-1 block w-full transition duration-150 ease-in-out pt-1.5 px-2 mt-1" data-controller="tags" data-tags-tag-collection data-tags-autocomplete="true" data-tags-show-dropdown="" data-target="tags.container">
<div class="flex flex-wrap cursor-text" data-action="click->tags#active">
<div class="flex flex-wrap" data-target="tags.tags">
<div class="text-sm p-2 bg-gray-100 rounded-md flex items-center space-x-1.5 mb-1.5 mr-2">
<p>tag</p>
<div class="inline-flex bg-gray-500 text-gray-100 rounded-full p-1 hover:bg-gray-700 cursor-pointer">
<svg class="h-3 w-3" fill="none" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" viewBox="0 0 24 24" stroke="currentColor"><path d="M6 18L18 6M6 6l12 12"></path></
@eminkel
eminkel / string_lookup.rb
Last active September 14, 2018 02:51
Find all values between curly braces in a string and match and replace based on case statement.
# includes Replacer
#
# replace :text
#
# Lookup.new("I am a string with {help_link}, replace me.").perform
# Returns => "I am a string with https://google.com, replace me."
module Replacer
def replace(text)
Lookup.new(text).perform