- Rails 7.0.2
- stimulus js
- importmaps
- dropzone.js
- direct upload ActiveStorage
This is simple implementation of technologies in hobby project of mine built in Rails7 where I need direct upload to S3.
This is simple implementation of technologies in hobby project of mine built in Rails7 where I need direct upload to S3.
| def fill_stripe_elements(card) | |
| using_wait_time(15) { within_frame('stripeField_card_element0') do | |
| card.to_s.chars.each do |piece| | |
| find_field('cardnumber').send_keys(piece) | |
| end | |
| find_field('exp-date').send_keys("0122") | |
| find_field('cvc').send_keys '123' | |
| find_field('postal').send_keys '19335' | |
| end } |
| #!/usr/bin/env ruby | |
| require "openssl" | |
| require "time" | |
| begin | |
| require "origami" | |
| rescue LoadError | |
| abort "origami not installed: gem install origami" | |
| end |
| https://rfc3161.ai.moda | |
| https://rfc3161.ai.moda/adobe | |
| https://rfc3161.ai.moda/microsoft | |
| https://rfc3161.ai.moda/apple | |
| https://rfc3161.ai.moda/any | |
| http://rfc3161.ai.moda | |
| http://timestamp.digicert.com | |
| http://timestamp.globalsign.com/tsa/r6advanced1 | |
| http://rfc3161timestamp.globalsign.com/advanced | |
| http://timestamp.sectigo.com |
| #List of product ids in sorted order. Get from jqueryui sortable plugin. | |
| #product_ids = [3,1,2,4,7,6,5] | |
| #product_ids.each_with_index do |id, index| | |
| # Product.where(id: id).update_all(sort_order: index+1) | |
| #end | |
| ##CASE syntax example: | |
| ##Product.where(id: product_ids).update_all("sort_order = CASE id WHEN 539 THEN 1 WHEN 540 THEN 2 WHEN 542 THEN 3 END") |
This is a fork of original gist https://gist.github.com/nrollr/3f57fc15ded7dddddcc4e82fe137b58e, with slight changes on pointing to 5.7 version branch, instead of 8 (latest default of MySQL in Hombrew).
This procedure explains how to install MySQL using Homebrew on macOS (Sierra 10.12 and up)
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"| # Based on: | |
| # http://unscriptable.com/2009/03/20/debouncing-javascript-methods/ | |
| debounce = (func, threshold, execAsap) -> | |
| timeout = null | |
| (args...) -> | |
| obj = this | |
| delayed = -> | |
| func.apply(obj, args) unless execAsap | |
| timeout = null |
| // First make sure the wrapper app is loaded | |
| document.addEventListener("DOMContentLoaded", function() { | |
| // Then get its webviews | |
| let webviews = document.querySelectorAll(".TeamView webview"); | |
| // Fetch our CSS in parallel ahead of time | |
| //const cssPath = 'https://raw.githubusercontent.com/mallowigi/slack-one-dark-theme/master/custom.css'; | |
| const cssPath = 'https://gist.githubusercontent.com/samholst/ffbfd26165d8ff9304aa99887bcae445/raw/cda7d818fb2c1fd252aa0ce0a55274331852e99c/slack_dark_theme.css'; | |
| let cssPromise = fetch(cssPath).then(response => response.text()); |
| @import url("https://fonts.googleapis.com/css?family=Bad+Script|Rajdhani"); | |
| :root { | |
| /* Modify these to change your theme colors: */ | |
| --primary: #E5C17C; | |
| --accent: #568AF2; | |
| --text: #ABB2BF; | |
| --background: #282C34; | |
| --background-elevated: #3B4048; | |
| /* These should be less important: */ | |
| --background-hover: #525964; |
But really this is just a goofy name for one of many options of dynamically creating methods in ruby which is part of that fancy business known as Metaprogramming. Which is a fancy name for the concept of writing code that 'writes' code. It's bananas and great and the best thing you will ever see in your career also it is terrible, horrible, no good and the worst thing you will ever see in your career. We are just going to go over what has been dubbed 'ghost' methods by someone who likes to have cool names for things, there is a lot more to metaprogramming in general than just this technique but it is a pretty good entry point.