Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View cupnoodle's full-sized avatar

soulchild cupnoodle

View GitHub Profile
@cupnoodle
cupnoodle / shopify_api_bug_report_template.txt
Created November 8, 2023 09:19
Shopify API Bug Report Template (use this so you can reply one less email)
What is the App ID and name?
What is the expected outcome of using the app? And what's happening instead of that intended outcome?
Timeframe - when did this start happening or, if it worked previously, when did it stop working?
Is the issue affecting a certain store, or multiple merchants? Please share the affected store(s) here:
@cupnoodle
cupnoodle / rails new.txt
Created July 26, 2022 09:34
Rails 7 - Rails new options
Usage:
rails new APP_PATH [options]
Options:
[--skip-namespace], [--no-skip-namespace] # Skip namespace (affects only isolated engines)
[--skip-collision-check], [--no-skip-collision-check] # Skip collision check
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/soulchild/.rubies/ruby-3.1.2/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
@cupnoodle
cupnoodle / scroll_to_actions.js
Created June 4, 2022 07:44
Scroll to order actions box after loading
<script>
var cancellable_hash = window.location.hash.substr(1);
if(cancellable_hash === 'actions'){
setTimeout(function() {
document.getElementById('cancellable-title').scrollIntoView();
}, 1500);
}
</script>
@cupnoodle
cupnoodle / order_confirmation_template.liquid
Created March 10, 2022 15:38
Order confirmation email template with line item properties
{% unless line.properties == empty %}
<ul style="list-style-type: none; padding: 0;">
{% for property in line.properties %}
<li><span class="order-list__item-variant">{{ property.first }}: {{ property.last }}</span></li>
{% endfor %}
</ul>
{% endunless %}
@cupnoodle
cupnoodle / Dockerfile
Last active November 26, 2020 11:45
Basic Rails 6 Dockerfile
FROM ruby:2.7
# Add the key of yarn repo
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update -yqq
RUN apt-get install -yqq --no-install-recommends nodejs yarn
@cupnoodle
cupnoodle / rails_up.scpt
Created November 25, 2020 09:39
AppleScript to run rails server, webpack dev server and rails console
tell application "Terminal"
activate
do script "rails server" in tab 1 of front window
my makeTab()
do script "./bin/webpack-dev-server" in selected tab of front window
delay 1
my makeTab()
do script "rails console" in selected tab of front window
end tell
@cupnoodle
cupnoodle / rails.scpt
Created November 24, 2020 17:52
AppleScript to run your rails server and webpack dev server
tell application "Terminal"
activate
do script "cd ~/Repository/path-to-your-rails-app; rails server" in tab 1 of front window
my makeTab()
do script "cd ~/Repository/path-to-your-rails-app; ./bin/webpack-dev-server" in selected tab of front window
end tell
on makeTab()
tell application "System Events" to keystroke "t" using {command down}
@cupnoodle
cupnoodle / application.html.erb
Created November 5, 2020 08:46
Example views/layout/application.html.erb that have multiple yield
<!DOCTYPE html>
<html>
<head>
<title>Sample Rails app</title>
<%= csrf_meta_tags %>
<%= csp_meta_tag %>
<meta name="viewport" content="width=device-width, initial-scale=1">
<%= stylesheet_pack_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
@cupnoodle
cupnoodle / deploy.rb
Created September 15, 2020 19:30
Capistrano deploy settings
# change this to your deploy user
set :user, 'deploy'
# change this to your rails app name
set :application, 'cool'
# change this to your rails app repository URL
set :repo_url, 'git@tea.littlefox.es:soulchild/capify_sample.git'
# Deploy to the user's home directory, no need to change this
@cupnoodle
cupnoodle / Capfile
Created September 15, 2020 06:44
Rails app Capfile
# Load DSL and set up stages
require "capistrano/setup"
# Include default deployment tasks
require "capistrano/deploy"
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git
require 'capistrano/rbenv'