Skip to content

Instantly share code, notes, and snippets.

View jaysonwhelpley's full-sized avatar

Jayson Whelpley jaysonwhelpley

View GitHub Profile
<html>
<body>
<a href="sms://+14035550185?body=I%27m%20interested%20in%20your%20product.%20Please%20contact%20me.">Send a SMS message</a>
</body>
</html>
# lib/tasks/db.rake
namespace :db do
desc 'Drop, create, migrate then seed the development database'
task reseed: [ 'db:drop', 'db:create', 'db:migrate', 'db:seed' ] do
puts 'Reseeding completed.'
end
end
@jaysonwhelpley
jaysonwhelpley / Calendar.scpt
Created June 25, 2021 16:19
Calendar Shortcut Apple Script - for use with BetterTouchTool
tell application "Google Chrome"
repeat with w in windows
set i to 1
repeat with t in tabs of w
if URL of t starts with "https://calendar.google" then
set active tab index of w to i
set index of w to 1
if URL of t is not "https://calendar.google.com/calendar/u/1/r/week" then
set URL of t to "https://calendar.google.com/calendar/u/1/r/week"
end if
@jaysonwhelpley
jaysonwhelpley / room_fill.js
Created October 5, 2020 22:13
Room filling.
// Room hosts array of strings.
let hosts = []
// Non-host attendees, array of strings.
let people = []
// Rooms to be populated next.
let rooms = []
// Assign each host to a room.
@jaysonwhelpley
jaysonwhelpley / crypto.js
Created December 2, 2021 17:34
A cryptogram/cryptography project to let my daughter solve problems by hand. (Hard mode.)
var set = [ "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", ".", "?", "'", " "]
var tier1 = Array.from({length: set.length}, (v, k) => k+1);
var tier2 = Array.from(tier1, x => x + set.length)
var tier3 = Array.from(tier2, x => x + set.length)
var tier4 = Array.from(tier3, x => x + set.length)
function encode(the_string) {
the_string = the_string.toUpperCase().replace("\"", "\'\'")
var numbers = [1,2,3,4,5,6,7,8,9,10,11,12,13]
var selections = []
for (var i = 0; i < 4; i++) {
selections.push(numbers.splice(Math.floor((Math.random()*numbers.length)),1).pop())
}
var cards = [Math.floor(Math.random()*13), Math.floor(Math.random()*13), Math.floor(Math.random()*13), Math.floor(Math.random()*13)]
var u1 = new Object();
var heads = 0
var tails = 0
var ratio = 0
var ratios = []
var ratioratio = 0
function flip() {
heads = 0
tails = 0