This file contains hidden or 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
| # frozen_string_literal: true | |
| require 'bundler/inline' | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'dotenv' | |
| gem 'ruby-openai' | |
| end |
This file contains hidden or 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
| node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" | |
This file contains hidden or 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
| # 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)}" |
This file contains hidden or 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
| // Note: this gist is a part of this OSS project that I'm currently working on: https://github.com/steven-tey/dub | |
| export default async function getTitleFromUrl (url: string) { | |
| const controller = new AbortController(); | |
| const timeoutId = setTimeout(() => controller.abort(), 2000); // timeout if it takes longer than 2 seconds | |
| const title = await fetch(url, { signal: controller.signal }) | |
| .then((res) => { | |
| clearTimeout(timeoutId); | |
| return res.text(); | |
| }) |
This file contains hidden or 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
| sudo su | |
| //Setup Hostname | |
| hostnamectl set-hostname subdomain.domain.tld | |
| ## Basic | |
| sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common | |
| //Setup SWAP | |
| sudo fallocate -l 1G /swapfile; | |
| ls -lh /swapfile; |
This gist will collects all issues we solved with Rails 5.2 and Webpacker
# Last few parameters(--skip-* part) is only my habbit not actully required
$ rails new <project_name> --webpack=stimulus --database=postgresql --skip-coffee --skip-test
This file contains hidden or 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
| 为hass接入小米空气净化器2 |
This file contains hidden or 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
| ! model | |
| pc101 Generic 101-key PC | |
| pc102 Generic 102-key (Intl) PC | |
| pc104 Generic 104-key PC | |
| pc105 Generic 105-key (Intl) PC | |
| dell101 Dell 101-key PC | |
| latitude Dell Latitude series laptop | |
| dellm65 Dell Precision M65 | |
| everex Everex STEPnote | |
| flexpro Keytronic FlexPro |
This file contains hidden or 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
| AMS1 | Amsterdam, The Netherlands | Europe | |
| AMS50 | Amsterdam, The Netherlands | Europe | |
| ARN1 | Stockholm, Sweden | Europe | |
| ATL50 | Atlanta, Georgia | United States | |
| ATL52 | Atlanta, Georgia | United States | |
| BOM2 | Mumbai, India | India | |
| BOM51 | Mumbai, India | India | |
| CDG3 | Paris, France | Europe | |
| CDG50 | Paris, France | Europe | |
| DEL51 | Paris, France | Europe |
NewerOlder