https://gist.github.com/ziadoz/3e8ab7e944d02fe872c3454d17af31a5
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
<script> | |
$(document).on('turbolinks:before-cache', function(e) { | |
$('.form-control.select2, .form-control.select2-taggable, .form-control.select2-w-100').each(function() { | |
if ($(this).data('select2')) { | |
$(this).select2('destroy'); | |
} | |
}); | |
}); | |
$('.form-control.select2, .form-control.select2-taggable, .form-control.select2-w-100').each(function() { |
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 PrettyHelper | |
def pretty_boolean(boolean) | |
boolean ? "Yes" : "No" | |
end | |
def pretty_array(array, seperator: ";") | |
array.to_a.join("; ") | |
end | |
def pretty_linked_record_array(array, field, new_window: true) |
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
# https://github.com/Shopify/erb-lint | |
linters: | |
DeprecatedClasses: | |
enabled: true | |
FinalNewline: | |
enabled: true | |
ErbSafety: | |
enabled: true | |
exclude: | |
- '**/node_modules/**' |
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
/* global $, HandlebarsTemplates */ | |
// For use with https://github.com/leshill/handlebars_assets | |
function renderTemplate(template, context) { | |
return HandlebarsTemplates[template](context) | |
} | |
function renderTemplateAt(query, template, context) { | |
return ( | |
$(query).html( | |
renderTemplate(template, context) |
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
// Note: Must use `var self = this` to access stuff within the success/error functions | |
Rails.ajax({ | |
url: action_path, | |
type: "PATCH", | |
data: $.param(data), | |
dataType: 'script', | |
processData: false, | |
contentType: false, | |
success: function(data) { }, | |
error: function(data) { } |
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
# This is a very simple hash based graph utility class. | |
# By Mykl Clason | |
# https://gist.github.com/MyklClason/fe603a6005a1dedc6ec65fda7ff47f68 | |
class Graph | |
def self.undirected_graph_from_edges(edges) | |
# Edges are (a,b) pairs with a => b and b => a relationships. | |
edges.each_with_object(Hash.new { |h, k| h[k] = Set.new }) { |(k, v), h| h[k] << v } | |
end | |
def self.directed_graph_from_edges(edges) |
https://yarnpkg.com/lang/en/docs/install/#debian-stable
Run Commands
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install --no-install-recommends yarn
Warning: This guide intended for Rails 6.1. (It may not be complete)
This is direction for Migration from c9.io to AWS Cloud9 or to simply setup AWS Cloud9 for Rails Development, after you follow the cloud9 migration directions and created a workspace, keeping in mind the Workspace settings Section below.
Be sure you are using the right version of rails. You may need to remove rails and rail-ties and install rails 6.1. Check online for how (search how to reinstall rails with a specific version)
NewerOlder