Skip to content

Instantly share code, notes, and snippets.

Avatar

Taylor Bell tayiorbeii

View GitHub Profile
@tayiorbeii
tayiorbeii / noNewTabs.js
Created Aug 2, 2018
Userscript to remove target=_blank
View noNewTabs.js
// ==UserScript==
// @name No New Tabs
// @match *://*/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
Array.from(document.querySelectorAll('a[target="_blank"]'))
@tayiorbeii
tayiorbeii / notWorkingWithStaticQuery.js
Last active Jul 18, 2018
Gatsby StaticQuery Errors
View notWorkingWithStaticQuery.js
// src/pages/index.js
import React from 'react'
import {StaticQuery, graphql} from 'gatsby'
import Layout from '../components/layout'
// const HomePage = ({data}) => {
// return (
// <Layout>
// {data.site.siteMetadata.description}
@tayiorbeii
tayiorbeii / subscribeForm.js
Created Jun 27, 2018
Example React ContactForm component that submits an email address to a Google Spreadsheet as well as a Mailchimp list via a Gatsby plugin following client side evaluation. The classnames are from Tachyons.io
View subscribeForm.js
import React, { Component } from 'react'
import axios from 'axios'
import validator from 'email-validator'
import addToMailchimp from 'gatsby-plugin-mailchimp'
// Directions here: https://medium.com/@dmccoy/how-to-submit-an-html-form-to-google-sheets-without-google-forms-b833952cc175
const formUrl = 'https://script.google.com/macros/s/YourKeyHere/exec'
const mailchimpUrl = 'https://REGION.api.mailchimp.com/3.0'
View google_script.gs
// original from: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
// original gist: https://gist.github.com/willpatera/ee41ae374d3c9839c2d6
function doGet(e){
return handleResponse(e);
}
// Enter sheet name where data is to be written below
var SHEET_NAME = "Sheet1";
@tayiorbeii
tayiorbeii / vimeo_downloader.py
Created Feb 24, 2017
Usage: `python vimeo_downloader.py http://...master.json optional_name.mp4` modified from https://gist.github.com/alexeygrigorev/a1bc540925054b71e1a7268e50ad55cd
View vimeo_downloader.py
import requests
import base64
from tqdm import tqdm
import sys
master_json_url = sys.argv[1]
base_url = master_json_url[:master_json_url.rfind('/', 0, -26) + 1]
resp = requests.get(master_json_url)
content = resp.json()
@tayiorbeii
tayiorbeii / 0_reuse_code.js
Created Jan 22, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tayiorbeii
tayiorbeii / Link.jsx
Created Apr 14, 2016
Link.jsx is a wrapper for react-router's Link that adds some helper functionality for things like relative links.
View Link.jsx