Skip to content

Instantly share code, notes, and snippets.

View abitgone's full-sized avatar

Anthony W abitgone

View GitHub Profile
@abitgone
abitgone / usingmoment.js
Created September 9, 2013 16:50
This uses moment.js to select the date of the next Leamington Geeks meetup. It chooses either the 3rd Tuesday of the month if it's December or the last Tuesday of the month if it's any other month. If that date has passed, it adds a month and starts the process again. Is this the best way to do that?
var today = moment(new Date()),
monthEnd,
nextDate;
do {
if (monthEnd === undefined) {
monthEnd = moment(new Date());
}
else {
monthEnd = monthEnd.add('months', 1);
@abitgone
abitgone / Making-Odometers…-Made-Easier.markdown
Last active December 30, 2015 03:18
A Pen by Anthony Williams.

Making Odometers… Made Easier

You should go here to see what I'm talking about. But it includes Sass for loops and mixins and it's really rather good, I think you'll agree.

A Pen by Anthony Williams on CodePen.

License.

@abitgone
abitgone / generate_tokens.js
Last active August 29, 2015 14:05
Quick and Dirty Daily Analytics Dump into MongoDB
/*
// Token Generation Script
//
// This will require you to visit the Google Developer Console at https://console.developers.google.com and
// create an app. You'll want to create a web application client ID and grab the client key and secret.
//
// This will then take you through the process of generating the keys in a quick and dirty fashion.
//
// Usual npm install shenanigans apply -- you'll need moment, mongodb and googleapis for this.
*/

Keybase proof

I hereby claim:

  • I am abitgone on github.
  • I am abitgone (https://keybase.io/abitgone) on keybase.
  • I have a public key whose fingerprint is E819 3617 5ECD 4CD1 FF9B 722E 5C1B 6B46 2CF1 1CA8

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am abitgone on github.
  • I am abitgone (https://keybase.io/abitgone) on keybase.
  • I have a public key ASB2MIi5CDDGM0cghbwO7NmGq9oizJJlVkk4k2Xbd_Uexgo

To claim this, I am signing this object:

@abitgone
abitgone / index.html
Created November 29, 2017 09:24
Hero Options Example // source http://jsbin.com/pemuqih
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" integrity="sha384-PsH8R72JQ3SOdhVi3uxftmaW6Vc51MKb0q5P2rRUpPvrszuE4W1povHYgTpBfshb" crossorigin="anonymous">
<script src="http://code.jquery.com/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js" integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js" integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="http://abitgone.github.io/jQuery-Plugins/ClassToggle/abitgone-classtoggle.js"></scri
@abitgone
abitgone / dw.date_publicholiday_uk.data.sql
Last active January 8, 2026 10:06
Creates a table, and seeds it with historic bank holiday dates from 1979 to 2028 (as at January 2026). Used in conjunction with an Azure Synapse Pipeline and Data Flow which loads UK Bank Holiday details from the public UK Bank Holidays feed at https://www.gov.uk/bank-holidays.json. (Data from GOV.UK JSON file is only available from 2019 onwards.)
WITH
BankHoliday AS (
SELECT
Holiday_Date_Observed,
Holiday_Name,
Holiday_Jurisdiction,
Holiday_Notes
FROM ( VALUES
('1979-01-01', 'New Year''s Day', 'england-and-wales', NULL),
('1979-01-01', 'New Year''s Day', 'scotland', NULL),