This file contains hidden or 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
# spec/mailers/previews/devise_mailer_preview.rb | |
class DeviseMailerPreview < ActionMailer::Preview | |
# We do not have confirmable enabled, but if we did, this is | |
# how we could generate a preview: | |
# def confirmation_instructions | |
# Devise::Mailer.confirmation_instructions(User.first, "faketoken") | |
# end | |
def reset_password_instructions |
This file contains hidden or 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> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>Lighthouse requestig malformed URLs</title> | |
</head> | |
<body> | |
<img width="200" height="420" src="https://lorempixel.com/420/320/abstract/1/Sample?query-param-to-get-over-75-chars" /> |
This file contains hidden or 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
# When Rails loads fixtures, it does so via a big multi-insert. If there is something wrong with a | |
# fixture, it's extremely difficult to find out _which_ fixture is wrong. | |
# This can be run in a binding.pry OR in a Rails console. | |
require "active_record/fixtures" | |
all = fixture_set_names = Dir["spec/fixtures/**/*.yml"].map { |f| File.basename f, '.yml' } | |
all.each do |fix| | |
puts fix; ActiveRecord::FixtureSet.create_fixtures("#{Rails.root}/spec/fixtures", [fix]) |
This file contains hidden or 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
# lib/carrierwave_ext/sanitized_file.rb | |
require "carrierwave/sanitized_file" | |
module CarrierWave | |
class SanitizedFile | |
## | |
# Returns the content type of the file. | |
# | |
# === Returns | |
# |
This file contains hidden or 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
<html> | |
<head> | |
<title>IE9 Download Example</title> | |
<script> | |
function legacyBrowserSave(content, filename) { | |
var frame = document.createElement("iframe"); | |
document.body.appendChild(frame); | |
frame.contentWindow.document.open("text/html", "replace"); | |
frame.contentWindow.document.write(content); |
This file contains hidden or 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
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem "activerecord" | |
gem "sqlite3" | |
gem "minitest" | |
end | |
require "minitest/autorun" |
This file contains hidden or 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
/* | |
* Documentation: http://www.mysensors.org | |
* Support Forum: http://forum.mysensors.org | |
*/ | |
#define MY_RADIO_NRF24 | |
#define CHILD_ID_HVAC 10 | |
#define MY_DEBUG | |
#include <MySensors.h> |
This file contains hidden or 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 AJAX prefilter is based on http://stackoverflow.com/a/12840617 with some changes: | |
* 1. References to the question asker's context have been removed (they related to Auth) | |
* 2. Fixes have been made to code style at JSHint's request. | |
* 3. Assign max retries so that we can determine how many retries we STARTED from. | |
* 4. Add a setTimeout call so that the retried requests wait before performing the request. | |
* 5. Treat a '0' status as an error. (JM: I believe this is because Ember fakes it's own 'XHR' object | |
* that doesn't contain the actual request status code). | |
*/ |
This file contains hidden or 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
# Like rspec --format doc, (which minitest doesn't have) | |
# | |
# usage: minidoc test/integration/robs_cool_potatoes_test.rb | |
minidoc() { | |
rscript=' | |
red = "\e[0;31m" | |
purple = "\e[0;35m" | |
green = "\e[0;32m" | |
blue = "\e[0;34m" | |
none = "\e[0m" |
This file contains hidden or 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
jQuery.fn.tableflip = function() { | |
console.log("╯°□°)╯︵ ┻━┻"); | |
return this; | |
} |
NewerOlder