Skip to content

Instantly share code, notes, and snippets.

View antonioJASR's full-sized avatar
💭
Grug

Antonio Sánchez antonioJASR

💭
Grug
View GitHub Profile
@antonioJASR
antonioJASR / frame
Created January 20, 2024 19:09 — forked from chadwhitacre/frame
#!/usr/bin/env zsh
# frame foo.webp bar.png
rm -rf framed
mkdir framed
for img in ${@:1}; do
magick "$img" \
-fuzz 1% -trim -bordercolor white -border 100 \
-resize "1024x576" \
-background "#EEE" -compose Copy -gravity center -extent "1600x900" \
"framed/$img"
@antonioJASR
antonioJASR / #ChatGPT Streaming.md
Created June 26, 2023 02:21 — forked from alexrudall/#ChatGPT Streaming.md
ChatGPT streaming with ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind!

How to add ChatGPT streaming to your Ruby on Rails 7 app!

This guide will walk you through adding a ChatGPT-like messaging stream to your Ruby on Rails 7 app using ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind. All code included below!

Alt Text

First, add the ruby-openai gem! Needs to be at least version 4. Add Sidekiq too.

@antonioJASR
antonioJASR / #ChatGPT Streaming.md
Created June 26, 2023 02:21 — forked from alexrudall/#ChatGPT Streaming.md
ChatGPT streaming with ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind!

How to add ChatGPT streaming to your Ruby on Rails 7 app!

This guide will walk you through adding a ChatGPT-like messaging stream to your Ruby on Rails 7 app using ruby-openai, Rails 7, Hotwire, Turbostream, Sidekiq and Tailwind. All code included below!

Alt Text

First, add the ruby-openai gem! Needs to be at least version 4. Add Sidekiq too.

@antonioJASR
antonioJASR / turbo_transitions.js
Created January 19, 2023 04:14 — forked from jaredcwhite/turbo_transitions.js
Nice transitions using Turbo
document.addEventListener("turbo:visit", () => {
let main = document.querySelector("main");
if (main.dataset.turboTransition == "false") return;
let [movement, scale] = ["-12px", "0.99"];
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) {
[movement, scale] = ["-6px", "1"]
};
@antonioJASR
antonioJASR / 1.md
Created November 29, 2018 03:25 — forked from swyxio/1.md
Learn In Public - 7 opinions for your tech career

1. Learn in public

If there's a golden rule, it's this one, so I put it first. All the other rules are more or less elaborations of this rule #1.

You already know that you will never be done learning. But most people "learn in private", and lurk. They consume content without creating any themselves. Again, that's fine, but we're here to talk about being in the top quintile. What you do here is to have a habit of creating learning exhaust. Write blogs and tutorials and cheatsheets. Speak at meetups and conferences. Ask and answer things on Stackoverflow or Reddit. (Avoid the walled gardens like Slack and Discourse, they're not public). Make Youtube videos or Twitch streams. Start a newsletter. Draw cartoons (people loooove cartoons!). Whatever your thing is, make the thing you wish you had found when you were learning. Don't judge your results by "claps" or retweets or stars or upvotes - just talk to yourself from 3 months ago. I keep an almost-daily dev blog written for no one else but me.

Guess what? It

@antonioJASR
antonioJASR / yardoc_cheatsheet.md
Created November 15, 2018 18:54 — forked from chetan/yardoc_cheatsheet.md
YARD cheatsheet

YARD CHEATSHEET http://yardoc.org

cribbed from http://pastebin.com/xgzeAmBn

Templates to remind you of the options and formatting for the different types of objects you might want to document using YARD.

Modules

Namespace for classes and modules that handle serving documentation over HTTP

javascript:(function(){
var css = document.createElement("style");
css.type = "text/css";
css.innerHTML = "img[alt=\"\"],img:not([alt]){ filter:grayscale(100%) }";
document.body.appendChild(css);
})();
@antonioJASR
antonioJASR / README.md
Created October 26, 2017 19:50 — forked from addyosmani/README.md
108 byte CSS Layout Debugger

CSS Layout Debugger

A tweet-sized debugger for visualizing your CSS layouts. Outlines every DOM element on your page a random (valid) CSS hex color.

One-line version to paste in your DevTools

Use $$ if your browser aliases it:

~ 108 byte version

@antonioJASR
antonioJASR / regenerate-binstubs.sh
Created October 3, 2017 19:58 — forked from demisx/regenerate-binstubs.sh
Regenerate and Springify Rails 4 binstubs
cd my_rails_app_root_dir
rm bin/*
bundle exec rake rails:update:bin
bundle binstubs rspec-core
spring binstub --all
@antonioJASR
antonioJASR / osx-setup.sh
Last active October 3, 2017 04:21 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc