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
// TODO: | |
// * work with all browser prefixes for event names | |
// * make error message more helpful | |
it('tests that a CSS animation ran correctly', function (done) { // <-- notice the done param | |
// Visit whatever route we are going to test | |
visit('/unique_testing_route') | |
.then(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
# Be sure to restart your server when you modify this file. | |
# Define an application-wide content security policy | |
# For further information see the following documentation | |
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy | |
Rails.application.config.content_security_policy do |policy| | |
# These directives define a quite strict policy by default. You may have to | |
# loosen this policy as you add elements to the app. Some examples of common | |
# additions are shown below. |
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 | |
# Purpose: | |
# | |
# * Edits .vscode/settings.json file to set a new theme for the project. | |
# * If no arg passed then a theme is chosen randomly. | |
# * You must already have the themes installed | |
# * You should edit the list of themes to match your favourites. | |
# | |
# Installation: |
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
# common helper functions | |
def replace_line(file_path:, old_line_regex:, new_line:) | |
new_lines = File.readlines(file_path, chomp: true).map do |line| | |
if old_line_regex.match?(line) | |
new_line | |
else | |
line | |
end | |
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
4ops.packer | |
adrianhumphreys.silverstripe | |
ahmadalli.vscode-nginx-conf | |
akamud.vscode-theme-onelight | |
alefragnani.rtf | |
aliariff.vscode-erb-beautify | |
andys8.jest-snippets | |
anotherglitchinthematrix.monochrome | |
anteprimorac.html-end-tag-labels | |
arcticicestudio.nord-visual-studio-code |
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 | |
# 1. save this somewhere on your path as 'retheme' | |
# 2. chmod u+x retheme | |
require 'json' | |
require 'fileutils' | |
THEMES = { | |
# shorthand-name => Actual theme name |
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
class ThingyExporter | |
SQL_QUERY_PATH = Rails.root.join("app/services/thingy_exporter/query.sql") | |
SQL_QUERY = File.read(SQL_QUERY_PATH) | |
HEADERS = %w[ | |
thingy_id | |
tag_id | |
thingy_filename | |
survey_question_token | |
tag_name |
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
/* | |
Usage: | |
* Paste this into your dev tools console (or even better as a snippet) | |
* It will parse the page and find all the things that create a new stacking context | |
and dump some info about them to the console. It will also outline them on the page. | |
* This is pretty rough and probably misses heaps of bugs and edge cases. | |
*/ | |
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
## | |
# id must be the id attribute of the editor instance (without the #) e.g. | |
# <textarea id="foo" ...></textarea> | |
# would be filled in by calling | |
# tinymce_fill_in 'foo', 'some stuff' | |
# | |
def tinymce_fill_in(id, val) | |
# wait until the TinyMCE editor instance is ready. This is required for cases | |
# where the editor is loaded via XHR. | |
sleep 0.5 until page.evaluate_script("tinyMCE.get('#{id}') !== null") |
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
class SaferRawSQL | |
TEXT_FORMAT = 0 | |
BINARY_FORMAT = 1 | |
## | |
# You must be using the PostgreSQL database to use this method because it | |
# relies on PostgreSQL features. | |
# | |
# This method returns the same results as `ActiveRecord::Base.execute` but it | |
# helps you avoid SQL injection attacks by using the PostgreSQL feature which |
NewerOlder