Skip to content

Instantly share code, notes, and snippets.

@JohnGoodman
JohnGoodman / tawk-to-widget-toggle-in-react.js
Last active September 8, 2023 06:52
Tawk.to React function to to toggle showing and hiding the widget
// In a react app, the Tawk.to widget loads before the React app, causing an error to be thrown
// if you need to interact with the widget on first load
// The code below checks to make see if the widget it initialized
// It handles toggling the widget even when it has not initalized yet
function tawkWidgetToggle(show){
// Ensure the Tawk object has initalized
if(window.$_Tawk && window.$_Tawk.init){
@JohnGoodman
JohnGoodman / flexbox-vertical-scaleable-columns-with-overflow-body-content.html
Last active June 29, 2021 22:04
Flexbox vertical scaleable columns with overflow body content
<!-- Codepen: https://codepen.io/John-Goodman/pen/jOmEqqB -->
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Flex Test</title>
<meta name="description" content="Flex Test">
html,body,input,select,textarea,button {
font:13px 'Tahoma',sans-serif!important;
line-height:17px!important;
font-weight:300!important;
}
.list-card a {
color:#444!important;
}
{
"ArgumentErrors": null,
"ErrorCode": 0,
"ErrorMessage": null,
"IsSuccess": true,
"Appointment": {
"BookingNumber": "100076425151",
"Confirmable": true,
"EndDateTime": "/Date(1405630800000-0400)/",
"FinalTotal": {
John-Goodmans-MacBook-Pro:weathervane jgoodman09$ bundle exec cap rubber:create_staging
triggering load callbacks
* 2013-04-01 17:41:33 executing `rubber:init'
* 2013-04-01 17:41:34 executing `rubber:create_staging'
Hostname to use for staging instance [production]:
Roles to use for staging instance [common,db:primary=true,monit,mysql,mysql_master,passenger_nginx,web_tools]:
* 2013-04-01 17:41:46 executing `rubber:create'
* Security Group already in cloud, syncing rules: weathervane_production_web_tools
* Security Group already in cloud, syncing rules: weathervane_production_mysql_master
* Security Group already in cloud, syncing rules: weathervane_production_monit
@JohnGoodman
JohnGoodman / rails_admin_duplicate_program.rb
Created February 23, 2012 19:28
Example custom action
require "rails_admin_duplicate_program/engine"
module RailsAdminDuplicateProgram
end
require 'rails_admin/config/actions'
module RailsAdmin
module Config
module Actions
@JohnGoodman
JohnGoodman / rails_admin.rb
Created February 23, 2012 19:26
Example rails_admin.rb file
RailsAdmin.config do |config|
# Define the actions so we can add duplicate program
config.actions do
# root actions
dashboard # mandatory
# collection actions
index # mandatory
new
export
history_index
@JohnGoodman
JohnGoodman / ckeditor relation issue
Created December 13, 2011 14:38
ActiveRecord::StatementInvalid in Ckeditor::PicturesController#index
ActiveRecord::StatementInvalid in Ckeditor::PicturesController#index
PGError: ERROR: relation "ckeditor_assets" does not exist
LINE 4: WHERE a.attrelid = '"ckeditor_assets"'::regclas...
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a.attnotnull
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"ckeditor_assets"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
Rake Routes:
new_user_session GET /login(.:format) {:controller=>"users/sessions", :action=>"new"}
destroy_user_session GET /logout(.:format) {:controller=>"users/sessions", :action=>"destroy"}
user_password POST /users/password(.:format) {:action=>"create", :controller=>"devise/passwords"}
new_user_password GET /users/password/new(.:format) {:action=>"new", :controller=>"devise/passwords"}
edit_user_password GET /users/password/edit(.:format) {:action=>"edit", :controller=>"devise/passwords"}
PUT /users/password(.:format) {:action=>"update", :controller=>"devise/passwords"}
users GET /users(.:format) {:action=>"index", :controller=>"users"}
POST /users(.:format) {:action=>"create", :controller=>"users"}