Skip to content

Instantly share code, notes, and snippets.

View camsloanftc's full-sized avatar

Cam Sloan camsloanftc

  • Squamish, Canada
View GitHub Profile
@camsloanftc
camsloanftc / test.js
Created October 17, 2021 18:37
Jquery - Append current url params to all urls on page
$("a").each(function () {
$(this).attr(
"href",
function () {
var currentUrlHasNoParams = location.search == ""
var hrefAlreadyHasQueryString = $(this).attr("href").includes("?")
var token = hrefAlreadyHasQueryString ? "&" : "?"
if(currentUrlHasNoParams){
return $(this).attr("href")
@camsloanftc
camsloanftc / render-aws-backup.ts
Created March 24, 2021 12:36 — forked from sjones6/render-aws-backup.ts
backup pg database to aws
import { spawn, execSync } from 'child_process';
import through2 from 'through2';
import fs from 'fs';
import * as AWS from 'aws-sdk';
function spawnPgDump(pgDumpPath, args, env) {
if (!fs.existsSync(pgDumpPath)) {
throw new Error('pg_dump not found at ' + pgDumpPath);
}
@camsloanftc
camsloanftc / gatsby-node.js
Created May 12, 2018 00:18
Example of a gatsby-node file
exports.createPages = ({ graphql, boundActionCreators }) => {
const { createPage } = boundActionCreators
return new Promise((resolve, reject) => {
graphql(
`
{
allContentfulBlogPost {
edges {
node {
@camsloanftc
camsloanftc / keybase.md
Created October 24, 2017 18:34
keybase auth

Keybase proof

I hereby claim:

  • I am camsloanftc on github.
  • I am camsloan (https://keybase.io/camsloan) on keybase.
  • I have a public key ASCTrdC0p9_AbrE1KWu5E5hXzGz7sW4N4Q7xTFERdCYsZgo

To claim this, I am signing this object: