Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View scottwater's full-sized avatar

Scott Watermasysk scottwater

View GitHub Profile
@scottwater
scottwater / base_webhook.json
Last active October 3, 2020 04:11
KickoffLabs WebHooks
{
"__event": "the_webhook_event",
"avatar": "https://d1ts43dypk8bqh.cloudfront.net/v1/avatars/310c4ac2-7026-4700-afde-496b1d217b03",
"counter": 252,
"contest_score": 300,
"contest_score_rank": 19588,
"custom_fields": {
},
"email": "scott@kickofflabs.com",
@scottwater
scottwater / test.js
Created April 10, 2020 18:54
Restripe a Table's Rows
reStripe() {
const rows = [...document.getElementsByClassName("archive-row")];
rows.forEach((element, index) => {
if (index % 2 == 0) {
element.classList.remove("bg-gray-50");
element.classList.add("bg-white");
} else {
element.classList.add("bg-gray-50");
element.classList.remove("bg-white");
}
@scottwater
scottwater / secure_resqueue_server_1.rb
Created April 13, 2011 14:08
Quick samples on securing Resque::Server
require 'resque/server'
class SecureResqueServer < Resque::Server
before do
redirect '/' unless some_condition_is_met!
end
end
@scottwater
scottwater / lb.html
Created November 4, 2019 14:39
Leaderboard Limit Override
<script>
window.kol_leader_board_options = {
board_settings: {
limit: 100
}
}
</script>
@scottwater
scottwater / tailwind.config.js
Created September 13, 2019 17:06
Nord color palette in Tailwind
module.exports = {
theme: {
extend: {
colors: {
nord: {
"0": "#2E3440",
"1": "#3B4252",
"2": "#434C5E",
"3": "#4C566A",
"4": "#D8DEE9",
@scottwater
scottwater / pageData.js
Created October 17, 2019 23:43
See what data is available on a page in Eleventy
eleventyConfig.addNunjucksTag("pageData", function(nunjucksEngine) {
return new (function() {
this.tags = ["pageData"];
this.parse = function(parser, nodes, _) {
var tok = parser.nextToken();
var args = parser.parseSignature(null, true);
// fake it until you make it!
// https://github.com/mozilla/nunjucks/issues/158#issuecomment-34919343
@scottwater
scottwater / kickoff.json
Last active August 6, 2019 17:57
KickoffLabs API Demo Response
{
"avatar": "https://d1ts43dypk8bqh.cloudfront.net/v1/avatars/310c4ac2-7026-4700-afde-496b1d217b03",
"counter": 252,
"contest_score": 300,
"contest_score_rank": 19588,
"custom_fields": {},
"email": "scott@kickofflabs.com",
"family_name": "Watermasysk",
"given_name": "Scott",
"id": 56999,
@scottwater
scottwater / lb.html
Last active June 12, 2019 15:28
Add this to the header of a KickoffLabs thank you page (until there is UI to make this setting)
<script>
window.kol_leader_board_options = {
board_settings: {
lead_description: 'full_name'
}
}
</script>
<script>
window.kol_leader_board_options = {
board_settings: {
lead_description: 'full_name'
}
}
</script>
@scottwater
scottwater / page.html
Created April 15, 2019 10:18
AnyForm Custom Callback
<script>
var kol_widget_options = {
callback: function(data) {
if (data.counter == 1) {
window.location = `https://YOURSITE.com?kid=${data.social_id}`;
} else {
window.location = data.redirect_url;
}
}
};