Skip to content

Instantly share code, notes, and snippets.

View 0x7466's full-sized avatar
:octocat:
🚀💯🙌

Tobias Feistmantl 0x7466

:octocat:
🚀💯🙌
  • TFM Agency GmbH
  • Austria
View GitHub Profile
@0x7466
0x7466 / tailwind_form_builder.rb
Created September 17, 2024 12:02 — forked from borama/tailwind_form_builder.rb
Tailwind-styled Simple Form builder example - see https://dev.to/nejremeslnici/styling-simple-form-forms-with-tailwind-4pel for all details
# This is a thin wrapper of the Simple Form builder. It delegates rendering the resulting form fields to Simple Form
# but typically amends the Tailwind classes of the various elements in the field layout. It tightly integrates with the
# unstyled wrapper (aka `:plain`) Simple Form configuration (see `simple_form.rb`). The methods support the same syntax
# as the original Simple Form methods but enhance it to support replacing defaylt Tailwind claseses.
class Builders::TailwindFormBuilder < SimpleForm::FormBuilder
# This is the basic method for rendering `<input>` tags and their variants.
def input(attribute_name, options = {}, &block)
# The default Tailwind classes for the various parts of the Simple Form wrapper layout.
input_class = "block w-full sm:text-sm ... #{'text-gray-500 bg-gray-50' if options.dig(:input_html, :disabled)}"
@0x7466
0x7466 / todoist-openapi.yml
Created November 15, 2023 21:23
Todoist OpenAPI
openapi: 3.0.0
info:
version: 1.0.0
title: Todoist API
license:
name: MIT
servers:
- url: https://api.todoist.com/rest/v2
paths:
/projects:
{
"openapi": "3.0.0",
"info": {
"title": "Kimai - API Docs",
"description": "JSON API for the Kimai time-tracking software: [API documentation](https://www.kimai.org/documentation/rest-api.html), [Swagger definition file](doc.json)\n",
"version": "0.7"
},
"paths": {
"/api/actions/timesheet/{id}/{view}/{locale}": {
"get": {
@0x7466
0x7466 / redis.conf
Created March 17, 2021 07:16
redis.conf
# Redis configuration file example.
#
# Note that in order to read the configuration file, Redis must be
# started with the file path as first argument:
#
# ./redis-server /path/to/redis.conf
# Note on units: when memory size is needed, it is possible to specify
# it in the usual form of 1k 5GB 4M and so forth:
#
@0x7466
0x7466 / tfm-hello-elementor-enable-widgets.php
Created January 7, 2021 09:34
Hello Elementor - Enable Widgets
<?php
/**
* @link https://tfm.agency
* @since 1.0.0
* @package Hello Elementor - Enable Widgets
*
* @wordpress-plugin
* Plugin Name: Hello Elementor - Enable Widgets
* Plugin URI: https://tfm.agency
* Description: Enable Widgets in Hello Elementor Theme.
@0x7466
0x7466 / tfm-woocommerce-shortcodes.php
Last active December 15, 2020 07:56
TFM Woocommerce Shortcodes
<?php
/**
* @link https://tfm.agency
* @since 1.0.0
* @package TFM WooCommerce Shortcodes
*
* @wordpress-plugin
* Plugin Name: TFM WooCommerce Shortcodes
* Plugin URI: https://tfm.agency
* Description: Bunch of needed shortcodes for WooCommerce.
@0x7466
0x7466 / Gemfile
Created December 1, 2020 21:28 — forked from dhh/Gemfile
HEY's Gemfile
ruby '2.7.1'
gem 'rails', github: 'rails/rails'
gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data
# Action Text
gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra'
gem 'okra', github: 'basecamp/okra'
# Drivers
@0x7466
0x7466 / .railsrc
Last active August 21, 2019 14:34
Rails template
--database=postgresql
--template=https://gist.githubusercontent.com/tobiasfeistmantl/a7893cc591b065772ec4bb216718f5b6/raw/5653f31fbcc960f711349632b98f7d0ebbecc090/rails_template.rb
--skip-coffee
@0x7466
0x7466 / le-cert.rb
Last active July 14, 2017 12:26
Easy to use Ruby script to register and authorize new domains on Let's Encrypt and getting certificates for them. Call 'ruby le-new.rb' and follow the instructions. Install OpenSSL and the ACMEClient gem before!
#!/usr/bin/env ruby
begin
require 'acme-client'
rescue LoadError
abort 'MISSING GEM! You haven\'t installed the ACME client. Install the gem with the command \'gem install acme-client\'.'
end
require 'openssl'
require 'resolv'
@0x7466
0x7466 / Contact.swift
Created March 17, 2016 14:44
Contact class
//
// Contact.swift
// Debtly
//
// Created by Tobias Feistmantl on 17/01/16.
// Copyright © 2016 Tobias Feistmantl. All rights reserved.
//
import Foundation
import Contacts