Skip to content

Instantly share code, notes, and snippets.


Travis Northcutt tnorthcutt

View GitHub Profile
tnorthcutt / CommitHistory.vue
Last active Sep 10, 2020
Gridsome commit history
View CommitHistory.vue
<div class="space-y-4">
v-for="commit in commits"
class="flex border-solid border border-gray-300 p-4"
tnorthcutt / index.php
Last active Sep 7, 2020 — forked from vsoch/index.php
Generate RSS feed for files in a directory folder. Put this file in a folder with files, modify the $allowed_ext variable to customize your extensions, and $feedName, $feedDesc, $feedURL, and $feedBaseURL. Then navigate to the folder on the web to see the xml feed. Done!
View index.php
header('Content-type: text/xml');
Runs from a directory containing files to provide an
RSS 2.0 feed that contains the list and modification times for all the
$feedName = "Name";
$feedDesc = "Description";
View mixin-in-vuex-action.js
// in mixins/trailingSlash.js
export default (url) => {
return url.replace(/\/?$/, "/");
// in app.js
import trailingSlash from "./components/mixins/trailingSlash";
methods: {
View clickbank-hook.php
// ConvertKit API Key:
$convertkitApiKey = 'your-convertkit-api-key';
// Map each of your Clickbank products to a ConvertKit tag ID, or leave this array empty to
// use the default tag for all products:
$convertkitTags = array(
'clickbankproduct1' => 'cktag1',
'clickbankproduct2' => 'cktag2',
'clickbankproduct3' => 'cktag3',
tnorthcutt /
Created Apr 24, 2019 — forked from vitorbritto/
Remove MySQL completely from Mac OSX

Remove MySQL completely

  1. Open the Terminal

  2. Use mysqldump to backup your databases

  3. Check for MySQL processes with: ps -ax | grep mysql

  4. Stop and kill any MySQL processes

  5. Analyze MySQL on HomeBrew:

    brew remove mysql
tnorthcutt / Member.php
Created Apr 11, 2019
Extending spatie/laravel-tags to limit to the current team in a Spark application
View Member.php
// Relevant parts of my Member.php model, which is the model that I'm applying tags to
* Using our own Tag model
* @see
* @return string
tnorthcutt / app.blade.php
Created Dec 10, 2018
Limiting user tracking in a Laravel Spark app to real users signed into the app (not admins or admins impersonating a user)
View app.blade.php
<?php if (Auth::user() && Spark::developer(Auth::user()->email) || session('spark:impersonator')) {
?> Spark.state.devmode = true; <?php
} else {
?> Spark.state.devmode = false; <?php
} ?>
if (Spark.state.user && !Spark.state.devmode) {
// Intercom, FullStory, etc. tracking goes here
View PluginUrlSet.js
setPluginUrl() {
// Deleting the default header
delete window.axios.defaults.headers.common['X-CSRF-TOKEN'];
// Calling the method that fetches the data from Github
this.fetchUrl().then(data => {
this.pluginUrl = data;
// Reset the axios default headers
View PluginUrlFetch.js
fetchUrl() {
return axios.get('')
.then(function (response) {
View spark-bootstrap.js
* We'll load the axios HTTP library which allows us to easily issue requests
* to our Laravel back-end. This library automatically handles sending the
* CSRF token as a header based on the value of the "XSRF" token cookie.
window.axios.defaults.headers.common = {
'X-Requested-With': 'XMLHttpRequest',
'X-CSRF-TOKEN': Spark.csrfToken
You can’t perform that action at this time.