Skip to content

Instantly share code, notes, and snippets.

View ashleytbasinger's full-sized avatar

Ashley Basinger ashleytbasinger

View GitHub Profile
@ashleytbasinger
ashleytbasinger / chat_client_handoff.js
Created March 17, 2021 21:42
chat_client_handoff
// load Drift and other chat client here
// if Drift should fire first, hide other chat client -- if the other way, hide Drift.
window.drift.on("conversation:buttonClicked", function(data) {
console.log(data);
if (data.buttonBody == "File a ticket") { // be sure to change text to match your implementaton
drift.unload();
// instantiate your other chat client code here (load client)
};
@ashleytbasinger
ashleytbasinger / support_handoff_liveagent.js
Last active March 15, 2021 21:01
support_handoff_liveagent.js
// load Drift and LiveAgent here
// if Drift should fire first, hide LiveAgent -- if the other way, hide Drift.
window.drift.on("conversation:buttonClicked", function(data) {
console.log(data);
if (data.buttonBody == "File a ticket") { // be sure to change text to match your implementaton
drift.unload();
liveagent.startChat('57370000000TN5N'); // change for your live agent ID
};
@ashleytbasinger
ashleytbasinger / multipurpose-1.html
Created September 21, 2015 02:26
HTML email template
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Multipurpose Responsive Email Template</title>
<style type="text/css">
#outlook a {padding: 0;}
body{width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; margin: 0; padding: 0;}
.ExternalClass {width: 100%;}
.ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;}
#backgroundTable {margin: 0; padding: 0; width: 100% !important; line-height: 100% !important;}
for (i = 1; i < 21; i++) {
if (i % 3 === 0 && i % 5 === 0) {
console.log("FizzBuzz");
} else if (i % 5 === 0) {
console.log("Buzz");
} else if (i % 3 === 0) {
console.log("Fizz");
} else {
console.log(i);
}
@ashleytbasinger
ashleytbasinger / rock-paper-scissors
Created July 11, 2015 20:42
rock-paper-scissors
var userChoice = prompt("Do you choose rock, paper or scissors?");
var computerChoice = Math.random();
if (computerChoice < 0.34) {
computerChoice = "rock";
} else if(computerChoice <= 0.67) {
computerChoice = "paper";
} else {
computerChoice = "scissors";
} console.log("Computer: " + computerChoice);
@ashleytbasinger
ashleytbasinger / heroku_names.txt
Last active December 25, 2015 00:39
Heroku names
def anonymizer
adjectives = [
"boiling", "hidden", "bitter", "misty", "loquacious", "empty", "dry", "dark",
"rick-rolled", "icy", "cryptic", "quiet", "caffeinated", "cool", "radiant", "electric",
"patient", "superfluous", "dawn", "crimson", "furious", "dry", "blue",
"billowing", "broken", "cold", "bearded", "falling", "frosty", "green",
"long", "late", "lingering", "bold", "little", "morning", "muddy", "blazing",
"red", "rough", "feisty", "small", "sparkling", "throbbing", "shy",
"wandering", "emo", "wild", "black", "screaming", "falling", "solitary",
"fragrant", "shielded", "snowy", "proud", "agile", "twerking", "thirsty",
require 'pry'
class Game
def initialize
puts "\nWELCOME to BLACKJACK!\n"
Deck.new
end
def deal_cards
@ashleytbasinger
ashleytbasinger / refactor_3.rb
Created September 7, 2013 17:16
refactor blackjack version 3
require 'pry'
class Game
puts "\nWELCOME to BLACKJACK!\n"
SUITS = ['♠', '♣', '♥', '♦']
VALUES = ['2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K', 'A']
def initialize
@deck = []
@ashleytbasinger
ashleytbasinger / array_assignment.rb
Created September 6, 2013 18:19
TDD array assignment code partner project with Kyle
#require 'Math'
class ArrayStatistic
def initialize(array)
@array = array
end
def largest
@array.sort[-1]
end
@ashleytbasinger
ashleytbasinger / anagram_generator.rb
Created September 6, 2013 00:29
anagram generator for ruby
#anagram generator
#so help me I will figure this out!
class String
def anagram
self.split(//).permutation.map { |a| a.join}
end
end
input = gets.chomp