Skip to content

Instantly share code, notes, and snippets.

@jackiig
jackiig / bookmarklet.js
Created April 8, 2020 15:29
Bookmarklet for quickly switching from DuckDuckGo to Google.
// Create a bookmark in your browser(s), and use the Javascript below as the "URL" portion of the bookmark.
// This use of Javascript in a bookmark is called a "Bookmarklet".
// Set your default search engine to DuckDuckGo: https://duckduckgo.com/install
// If you find you're not getting the results you want, click the Bookmarklet.
javascript:window.location = window.location.toString().replace('duckduckgo.com/', 'google.com/search');
@jackiig
jackiig / example.html
Last active March 23, 2020 19:04
Embedded COVID-19 Banner
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8">
<script>
window.pc19=window.pc19||function(){(pc19.q=pc19.q||[]).push(arguments)};
pc19('covid_header');
pc19('covid_footer', 'Our custom text for the footer version.');
</script>
<script src="https://covid.polmaker.com/js/banner.js"></script>
Congratulations and thank you for purchasing your insurance online!
Your policy number is 9100003. You should always carry your policy with you while driving. Please refer to your policy for claims handling instructions including important telephone contact information in the event that you have a loss.
If you have not yet printed your policy, you can retrieve it from here:
https://example.com/get_policy/To download the attached insurance contract, you will require Adobe PDF Viewer (also known as Adobe Reader) to open the attachment. You can obtain a copy of this free software at:
http://www.adobe.com/
TODO - Temporary medical product verbiage.Thank you for your business.
@jackiig
jackiig / output.txt
Last active February 13, 2018 22:22
ERB output trimmed? Squashed?
---
FooBarBaz---
@jackiig
jackiig / auto.rb
Last active February 12, 2018 23:21
Trying to use virtual collections inside of a virtual collection.
# Required for anonymous struct of cross_sell products.
require 'disposable/twin/struct' # Disposible version 0.4.3.
# Contract for validating input for sending an auto email.
class Email::ThankYou::Auto::Contract < Reform::Form # Reform version: 2.2.4
# Included for cross_sell to construct itself.
include Disposable::Twin::Property::Struct
property :username, virtual: true
validates :username, presence: true
@jackiig
jackiig / rp-sticky-test.rb
Created December 4, 2015 22:01
Testing sticky sessions.
#!/usr/bin/env ruby
# curl -ik 'https://54.183.250.60/whoami.mhtml' -H 'Cache-Control: max-age=0' -H 'Cookie: ROUTEID=.node2'
require 'net/https'
require 'uri'
ARGV[0] ||= "node2"
uri = URI.parse("https://54.183.250.60/whoami.mhtml?route=#{ARGV[0]}")
http = Net::HTTP.new(uri.host, uri.port)
@jackiig
jackiig / client-app.js
Last active August 29, 2015 14:22
Tracker / ReactiveVar in Flack
Template.CommentAdd.events({
'submit form': function(e, tmpl) {
e.preventDefault();
formEl = tmpl.find('form');
comment = tmpl.find('[name=comment]').value;
if (comment.trim().length == 0) { return false; };
Comments.insert({
login: Meteor.user().profile.login,
timestamp: new Date,
room: Session.get('activeRoom'),