How to manage polymorphic associations with simple_form and JQuery?
This is a solution.
.
├── app
│ ├── assets
// Remove all drafts from your drafts view | |
// Navigate to drafts | |
// F12 to raise dev console | |
// Paste the below | |
(async function(x) { | |
for (let e = document.querySelector('[type="trash"]'); e != null; e = document.querySelector('[type="trash"]')) { | |
e.click(); | |
await new Promise(resolve => setTimeout(resolve, 500)) | |
document.querySelector('[data-qa="drafts_page_draft_delete_confirm"]').click(); | |
await new Promise(resolve => setTimeout(resolve, 1500)) |
# Nothing to require | |
# You can define your seed or generate one using system random function | |
seed = srand | |
prng = Random.new(seed) | |
# Generate X bytes | |
X = 16 | |
bin_str = prng.bytes(X) |
class RouteRecognizer | |
attr_reader :paths | |
# To use this inside your app, call: | |
# `RouteRecognizer.new.initial_path_segments` | |
# This returns an array, e.g.: ['assets','blog','team','faq','users'] | |
INITIAL_SEGMENT_REGEX = %r{^\/([^\/\(:]+)} | |
def initialize |
def valid? version | |
pattern = /^\d+\.\d+\.\d+(\-(dev|beta|rc\d+))?$/ | |
raise "Tried to set invalid version: #{version}".red unless version =~ pattern | |
end | |
def correct_version version | |
ver, flag = version.split '-' | |
v = ver.split '.' | |
(0..2).each do |n| | |
v[n] = v[n].to_i |
[Default Applications] | |
x-scheme-handler/txmt=openInMine.desktop |
gconftool-2 -s /desktop/gnome/url-handlers/txmt/command '/usr/local/bin/openInMine "%s"' --type String | |
gconftool-2 -s /desktop/gnome/url-handlers/txmt/enabled --type Boolean true |