Skip to content

Instantly share code, notes, and snippets.

View dhnaranjo's full-sized avatar

Desmond Naranjo dhnaranjo

  • MindMetrix
  • Chicago, IL
View GitHub Profile
@dhnaranjo
dhnaranjo / phlex_prompt.md
Last active May 22, 2023 19:39
An LLM prompt explaining the Phlex Ruby gem.

The following is an example of the main functionality of the Ruby gem Phlex. Phlex is a framework for building fast, reusable, testable views in pure Ruby. Use this example to guide you in converting HTML, React, Vue, or any similar markup to Phlex. Respond to this message with "OK" and await further instructions.

require 'phlex' # Ensure you have the Phlex gem installed

class Hello < Phlex::HTML
  def initialize(name:, active: false)
@dhnaranjo
dhnaranjo / 01_robo_junior.rb
Last active August 3, 2023 20:15
A cute AI-powered junior engineer to maybe do something useful.
# Required gems:
# - asimov
# - fast_ignore
class RoboJunior
def get_to_work
puts(changes)
Changer.new.change_stuff(changes)
end
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
gem 'rails'
gem 'debug'
end
require 'rails/all'
require 'minitest/autorun'
@dhnaranjo
dhnaranjo / define_methods_within_scopes.rb
Created October 19, 2022 02:18
Tryinna work out a cleaner way to access Phlex components
# frozen_string_literal: true
require "singleton"
require "bundler/inline"
gemfile do
gem "phlex"
end
class ComponentRegistry
import random
time = random.choice([
"In the year 2020",
"In the year 3000",
"In the year 6969",
"In the year 42069",
"When you get your dream job",
"When your father comes back from the milk and cigarette store",
"This year",
#!/bin/bash
# Install a custom MySQL 8.0 version - https://www.mysql.com
#
# To run this script on Codeship, add the following
# command to your project's setup commands:
# \curl -sSL https://raw.githubusercontent.com/codeship/scripts/master/packages/mysql-8.0.sh | bash -s
#
# Add the following environment variables to your project configuration
# (otherwise the defaults below will be used).
# * MYSQL_VERSION
# System config settings
Set-ExplorerOptions -showProtectedOSFiles -showFileExtensions
cinst Microsoft-Hyper-V-All -source windowsFeatures
# Basic biz
cinst googlechrome
cinst firefox
cinst vim
cinst visualstudiocode
cinst qbittorrent