Skip to content

Instantly share code, notes, and snippets.

View theprojectsomething's full-sized avatar

theprojectsomething

View GitHub Profile
@theprojectsomething
theprojectsomething / Timer.js
Created March 17, 2014 07:26
Timer - a simple JS timing implementation utilising requestAnimationFrame.
/*
Timer
- utilises animation frames (with a fallback to setTimeout when using the polyfill, below)
- returns remaining (or running) time
- pass a callback [fn], with an optional duration [ms] and autotart [bool], to the constructor or 'init' method
eg. new Timer(foo, 1000) *or* (new Timer()).init(foo, 0, true)
- for uniform x-browser support combine with the requestAnimationFrame polyfill from Erik Möller, et. al.
[https://github.com/darius/requestAnimationFrame]
*/
@theprojectsomething
theprojectsomething / SassMeister-input.scss
Created July 2, 2014 08:30
Generated by SassMeister.com.
// ----
// Sass (v3.3.9)
// Compass (v1.0.0.alpha.20)
// ----
$a: 'body[data-type]';
$b: 'body[data-type]',
'body[data-type=none]';
@mixin parent ($vars) {
@theprojectsomething
theprojectsomething / MediaQuery.scss
Last active August 29, 2015 14:03
Generated by SassMeister.com.
// ----
// Sass (v3.3.0.rc.2)
// Compass (v1.0.0.alpha.17)
// ----
@function calculate-ranges($breaks) {
$ranges: ();
$length: length($breaks);
@for $i from 1 through $length - 1 {
@theprojectsomething
theprojectsomething / serverless-redirect-aws.md
Last active May 20, 2017 12:02
Create a Serverless SSL Redirect with AWS

AWS Serverless SSL Redirect

Creating a serverless redirect requires four AWS services:

  • S3
  • Certificate Manager
  • Cloudfront
  • Route 53

Before You Start

Use the template below to create index.html. Include the URL you are redirecting to in place of {{ URL }}

@theprojectsomething
theprojectsomething / launchpack.md
Last active May 21, 2017 08:35
launchpack - an npm-powered boilerplate launcher 👊

LaunchPack

An npm-powered boilerplate launcher 👊
  1. Download this gist
  2. drop the package.json where you develop .. say ~/www
  3. online with npm installed? open a terminal and boom ...
npm run launchpack
@theprojectsomething
theprojectsomething / node-npm-install.md
Last active August 2, 2017 08:57
Installing Node + NPM (the right way)

Installing Node + NPM (the right way)

Follow the steps below to get Node and NPM running cleanly on your machine.

1. Uninstall Node + NPM

npm uninstall npm -g
rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
rm -rf /usr/local/include/node /Users/$USER/.npm
rm /usr/local/bin/node
@theprojectsomething
theprojectsomething / haproxy-multisite.md
Last active May 7, 2020 15:28
Guide: Multi-site / single-server with Linux Containers + HAProxy

Multi-site / single-server with Linux Containers + HAProxy

The below was completed on a Vultr 1xCPU / 1GB VC2 running Ubuntu 18.04, based on tutorials from Digital Ocean and SSDNodes, alongside various other helpful resources. Instructions do not work on Ubuntu 18.10.

Using this system I currently pay US$5.00 per month to host 2x wordpress sites (1x ecommerce) and 1x static nginx.

If you like the guide, consider signing up to Vultr with my affiliate code. Thanks!

Improvements to the guide (or better explanations) are most appreciated!

@theprojectsomething
theprojectsomething / index.js
Last active November 7, 2019 09:34
Firebase Cloud Functions: Multi-file setup
const functions = require('firebase-functions');
const path = require('path');
const glob = require('glob');
const ENDPOINT_FOLDER = './endpoints';
const DO_NOT_DEPLOY = /^(admin|a|debug|d)$/;
const IGNORE = /^(ignore|i)$/;
const BREAK_ON_ERROR = true;
const is = {
@theprojectsomething
theprojectsomething / a-short-history-of-reef-tracks-dot-org.md
Last active May 6, 2020 08:51
My site is up against NASA for a science webby

ReefTracks.org is up for a Webby

A short history of ReefTracks.org

Back in 2018 I was chatting to some shark researcher mates about their GPS tracking efforts, and how they were using video to manually animate their tagged sharks’ movements across the Great Barrier Reef. I love maps, and I thought I could speed up their workflow with a web-based animation they could screen record. I think they were dubious at the time, but I spent a few hours knee-deep in mapbox and codepen and sent through a rough demo anyway [1].

We didn’t really discuss it again until January 2019 when one of their whale sharks (GBR1), who I’d included in the demo, started pinging in frequently while tracking north towards Papua New Guinea. It was a real thrill to watch and became one of the longest recorded tracks for a whale shark.

I run the tech side of things at a very “4 people” small conser

@theprojectsomething
theprojectsomething / Firefox Pretty Tree Style Tab.md
Last active October 31, 2024 11:51
Tree Style Tab: Sliding sidebar / pinned + active tabs

Firefox pretty sliding sidebar / pinned / active tab theme for Tree Style Tab

Features

  • Auto-sliding draw for TST
  • Leaves 'pinned' and 'active' tabs visible in standard browser chrome
  • Leaves 'last-active' tabs visible for 3 minutes after becoming inactive
  • Where an active tab is pinned, leaves 'last-active' tab (x1) visible for 1hr

tree-style-tabs-theme