Skip to content

Instantly share code, notes, and snippets.

stephan.com stephancom

Block or report user

Report or block stephancom

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:c26791f85ac29b62e87f5ce05d7c1c33
Hub.all.map { |h| {id: h.id, name: h.name, weekday_hours: h.weekday_hours, saturday_hours: h.saturday_hours, sunday_hours: h.sunday_hours } }
=> [{:id=>41, :name=>"Next Cleaners Soho", :weekday_hours=>"2:30AM-2:30PM", :saturday_hours=>"5AM-1PM", :sunday_hours=>"7AM-2PM"}, {:id=>15, :name=>"Next Cleaners West Village", :weekday_hours=>"2AM-4PM", :saturday_hours=>"5AM-1PM", :sunday_hours=>"CLOSED"}, {:id=>64, :name=>"Next Cleaners Ashland Place", :weekday_hours=>"9:30AM-2:30PM", :saturday_hours=>"5:30AM-10:30AM", :sunday_hours=>"CLOSED"}, {:id=>65, :name=>"Next Cleaners Kent Ave", :weekday_hours=>"6:30AM-3:30PM", :saturday_hours=>"5:30AM-11:30AM", :sunday_hours=>"CLOSED"}, {:id=>71, :name=>"Marta's Cleaners", :weekday_hours=>"2:30AM-3:30PM", :saturday_hours=>"4AM-1PM", :sunday_hours=>"CLOSED"}, {:id=>72, :name=>"Grand Cleaners", :weekday_hours=>"3AM-2PM", :saturday_hours=>"3AM-1PM", :sunday_hours=>"CLOSED"}, {:id=>63, :name=>"Next Cleaners DoBro", :weekday_hours=>"2:30AM-10AM", :saturday_hours=>"5:30AM-11:30AM
@stephancom
stephancom / audit_dummy.rb
Created Dec 13, 2019
AuditDummy: handy for use in PaperTrail for a fake user that can have a GID
View audit_dummy.rb
# ,ggg,
# dP""8I 8I I8
# dP 88 stephan.com 8I I8
# dP 88 presentsL 8I gg 88888888
# ,8' 88 8I "" I8
# ,gggggggggggg, d88888888 gg gg ,gggg,8I gg I8
# dP"""88""""""Y8b, __ ,8" 88 I8 8I dP" "Y8I 88 I8
# Yb, 88 `8b, dP" ,8P Y8 I8, ,8I i8' ,8I 88 ,I8,
# `" 88 `8b Yb,_,dP `8b,,d8b, ,d8b,,d8, ,d8b,_,88,_,d88b,
# 88 Y8 "Y8P" `Y88P'"Y88P"`Y8P"Y8888P"`Y88P""Y88P""Y8
@stephancom
stephancom / imperial.rb
Created Dec 13, 2019
feet/inches utilities
View imperial.rb
# ___ _ _
# |_ _|_ __ _ __ ___ _ _(_)__ _| |
# | || ' \| '_ \/ -_) '_| / _` | |
# |___|_|_|_| .__/\___|_| |_\__,_|_|
# |_|
module Imperial
extend ActiveSupport::Concern
included do
# options for select menu
@stephancom
stephancom / activeadmin_top_sidebar.rb
Created Dec 7, 2019
Monkey patch ActiveAdmin to allow sidebars placed at the top
View activeadmin_top_sidebar.rb
module ActiveAdmin
class DSL
alias bottom_sidebar sidebar
def top_sidebar(name, options = {}, &block)
config.sidebar_sections.prepend ActiveAdmin::SidebarSection.new(name, options, &block)
end
def sidebar(name, options = {}, &block)
if options.delete(:prepend)
@stephancom
stephancom / activeadmin_top_sidebar.rb
Created Dec 7, 2019
Monkey patch ActiveAdmin to allow sidebars placed at the top
View activeadmin_top_sidebar.rb
module ActiveAdmin
class DSL
alias bottom_sidebar sidebar
def top_sidebar(name, options = {}, &block)
config.sidebar_sections.prepend ActiveAdmin::SidebarSection.new(name, options, &block)
end
def sidebar(name, options = {}, &block)
if options.delete(:prepend)
View blink_1.rb
@stephancom
stephancom / all_scratch.sublime.py
Created Aug 13, 2019
set all tabs to scratch for closing in sublime
View all_scratch.sublime.py
len([v.set_scratch(True) for v in sublime.Window.views(sublime.active_window())])
View rebase_deploy.sh
git branch devserver-scratch devserver
git checkout devserver-scratch
git rebase development
sed -i delme "s/set :branch.*/set :branch, \'devserver-scratch\'/" config/deploy.rb
git push --force -u origin devserver-scratch
cap devserver deploy
rm config/deploy.rb
mv config/deploy.rbdelme config/deploy.rb
git checkout development
git branch -D devserver-scratch
@stephancom
stephancom / antivaxxer.md
Last active May 14, 2019
notes on vaccine video
View antivaxxer.md

first video https://youtu.be/Q6u8yJpV3qg

  1. 0:00 You actually expect me to take seriously a video by "Mango & Space Panther" over the Center for Disease Control, the Food and Drug Agency, and the American Medical Association. I have an open mind, but I think I may need a bigger speculum.

  2. 2:10 Don't give me some asshole's hippie conspiracy theory twitch video, give me the data, I can do math. The one you want is here: https://www.who.int/vaccine_safety/initiative/tools/MMR_vaccine_rates_information_sheet.pdf?ua=1 . I'm gonna read that and do my own math BEFORE I watch the rest of the video

... and of course I'll be ignoring the mild adverse events as the video says it will do, particularly since I expect in many of those cases the event might have been caused by something else. I'll also note that, personally, I would much prefer my child to have an "adverse event" happen in the doctors office or shortly after immunization is given and care (such as epinephrine for an allergic reaction) is immediate

@stephancom
stephancom / markdown_fields.rb
Created May 6, 2019
Markdown fields concern
View markdown_fields.rb
# __ __ _ _ ___ _ _ _
# | \/ |__ _ _ _| |____| |_____ __ ___ _ | __(_)___| |__| |___
# | |\/| / _` | '_| / / _` / _ \ V V / ' \| _|| / -_) / _` (_-<
# |_| |_\__,_|_| |_\_\__,_\___/\_/\_/|_||_|_| |_\___|_\__,_/__/
#
# "Immature poets imitate; mature poets steal" - T. S. Eliot
# "When there's anything to steal, I steal" - Pable Picasso
# "Good artists copy; great artists steal" - Steve Jobs
#
module MarkdownFields
You can’t perform that action at this time.