This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
require 'bundler/inline' | |
gemfile(true) do | |
source 'https://rubygems.org' | |
git_source(:github) { |repo| "https://github.com/#{repo}.git" } | |
gem 'rails', '~> 7.0.5' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See https://til.magmalabs.io/posts/eb568eed39-make-rails-properly-decode-hashes-and-arrays-in-jsonb-fields-the-way-god-intended | |
ActiveRecord::Type::Json.class_eval do | |
# this is a json field, thus always decode it | |
def deserialize(value) | |
ActiveSupport::JSON.decode(value) rescue nil | |
end | |
def serialize(value) | |
if value.is_a?(::Array) || value.is_a?(::Hash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const myFunc = function () {}; | |
export default myFunc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# frozen_string_literal: true | |
# rubocop:disable Metrics/LineLength | |
require 'yaml' | |
require 'digest' | |
require 'erb' | |
return if ENV['NO_DB_SWITCH'] == '1' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'yaml' | |
# Return if this is not a branch checkout. | |
return if ARGV[2] != '1' | |
def drop_existing_connections_to_database(database_name) | |
system(%[psql --command="SELECT pg_terminate_backend(pg_stat_activity.pid) FROM pg_stat_activity WHERE pg_stat_activity.datname = '#{database_name}' AND pid <> pg_backend_pid();" postgres > /dev/null]) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module AssetsAnywhere | |
class Middleware | |
def initialize(app) | |
@app = app | |
@builder = Builder.new | |
end | |
def call(env) | |
@builder.attempt(env) || @app.call(env) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SideLoadAssets | |
module_function def append(view, path) | |
identifier = "/#{path}|" | |
path = Rails.root.join(path) | |
path.sub_ext('.js').exist? && view.content_for(:side_loaded_js, identifier) | |
path.sub_ext('.css').exist? && view.content_for(:side_loaded_css, identifier) | |
end | |
module Monkey |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" style="height: 100% !important; width: 100% !important; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; margin: 0 auto; padding: 0;"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<meta charset="utf-8"> <!-- utf-8 works for most cases --> | |
<meta name="viewport" content="width=device-width"> <!-- Forcing initial-scale shouldn't be necessary --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <!-- Use the latest (edge) version of IE rendering engine --> | |
<meta name="x-apple-disable-message-reformatting"> <!-- Disable auto-scale in iOS 10 Mail entirely --> | |
<title>You have a new session with %{client_name}</title> <!-- The title tag shows in email notifications, like Android 4.4. --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import Modal from 'react-modal/lib/index' | |
Modal.setAppElement(document.getElementById('codio')) | |
Modal.injectCSS() | |
export default React.createClass({ | |
displayName: 'ModalConfirm', | |
propTypes: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HTTP ERROR 500 | |
Problem accessing /ac2.server.core/. Reason: | |
Error creating bean with name 'jsonDispatcher' defined in URL [file:ac.resources/configs/server-beans.xml]: Cannot resolve reference to bean 'invoker' while setting bean property 'invoker'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'invoker' defined in URL [file:ac.resources/configs/server-beans.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jsonDispatcher' defined in URL [file:ac.resources/configs/server-beans.xml]: Cannot resolve reference to bean 'invoker' while setting bean property 'invoker'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'invoker' defined in URL [file:ac.resources/configs/server-beans.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: |
NewerOlder