Skip to content

Instantly share code, notes, and snippets.

Avatar
🔧
creating, building. what else is new?

Jason jschee

🔧
creating, building. what else is new?
View GitHub Profile
View clear_queue.rb
## i stash this in rails root folder and run it when i need to clear my sidekiq queues in development.
require 'sidekiq/api'
Sidekiq::Queue.all.each(&:clear)
Sidekiq::RetrySet.new.clear
Sidekiq::ScheduledSet.new.clear
Sidekiq::DeadSet.new.clear
@jschee
jschee / walmart.rb
Last active Nov 13, 2020
ps5 walmart browser automation
View walmart.rb
require "watir"
browser = Watir::Browser.new(:chrome, switches: ['--incognito'])
sleep 2
browser.goto("https://www.walmart.com/ip/PlayStation-5-Console/363472942") ## or https://www.walmart.com/ip/Sony-PlayStation-5-Digital-Edition/493824815
sleep 4
browser.button(class: ["button", "spin-button", "prod-ProductCTA--primary", "button--primary"]).click
sleep 4
browser.button(class: ["button", "ios-primary-btn-touch-fix", "hide-content-max-m", "checkoutBtn button--primary"]).click
sleep 4
@jschee
jschee / css code snippet sparkle cms
Last active Jun 27, 2020
css code snippet for sparkle cms
View css code snippet sparkle cms
Oh Hello Sparkle CMS...
Here's something I'm somewhat proud of.
A few years back I decided to not use a ui framework to build my website(although I do enjoy using tailwindcss, tachyons, and bootstrap).
This gave me the opportunity to learn about sass, css resetting, and how to properly use mixins...
To see some of this css in action check out this page I created just for you SparkleCMS.
https://jasonchee.me/sparklecms/hello
_mixins.scss
@jschee
jschee / rails new project
Last active Apr 28, 2020
rails new project
View rails new project
rails new \
-d postgresql \
--skip-keeps \
--skip-test \
--skip-bundle \
--skip-javascript \
-S \
-C \
-m https://raw.githubusercontent.com/jschee/temp_asset/master/asset/eightyeight_template.rb \
APP_NAME
@jschee
jschee / Turbolinks meta head tag
Last active Apr 27, 2020
Turbolinks meta head tag
View Turbolinks meta head tag
@jschee
jschee / prawn fixed header & footer combination with padded box helper
Last active Jun 10, 2020
prawn fixed header & footer combination with padded box helper
View prawn fixed header & footer combination with padded box helper
@jschee
jschee / mixins example
Last active Apr 27, 2020
mixins example
View mixins example
// Typography ———————————————————————————————— •
$font-serif: 'Marriweather', Georgia, serif;
$font-sans: "Roboto", "Segoe UI", "Helvetica Neue", "Lucida Grande", sans-serif;
@mixin font-smoothing($attr) {
-webkit-font-smoothing: $attr;
font-smoothing: $attr;
}
// Colors ———————————————————————————————————— •
View gist:7222c62203423f3f0490385fa99e9d40
html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,figcaption,figure,footer,header,hgroup,menu,nav,section,summary,time,mark,audio,video{border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
body{line-height:1;}
article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block;}
nav ul{list-style:none;}
blockquote,q{quotes:none;}
blockquote:before,blockquote:after,q:before,q:after{content:none;}
a{font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0;}
ins{background-color:#ff9;color:#000;text-decoration:none;}
mark{background-image: linear-gradient(to right, rgba(250, 209, 109, 0.3), rgba(250, 209, 109, 0.6), rgba(250, 209, 109, 0.5)); font-style:italic; border-radius: 0.6em; border-top-left-radius:
@jschee
jschee / active_storage tutorial aliyun as example
Last active Apr 27, 2020
active_storage tutorial aliyun as example
View active_storage tutorial aliyun as example
#step_1 create migration
#rails active_storage:install
#rails db:migrate
#step_2 add adapter gem of bucket provider
# e.g. gem 'activestorage/aliyun'
# bundle install
View gist:38107a34c439370352dd1c3c3e7685a0
# source 'https://rubygems.org'
source 'https://gems.ruby-china.com'
# git_source(:github) { |repo| "https://github.com/#{repo}.git" }
ruby '2.5.1'
# CORE GEMS
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' => someday baby
gem 'rails', '~> 6.0.2', '>= 6.0.2.1'
gem 'pg', '>= 0.18', '< 2.0'
You can’t perform that action at this time.