Skip to content

Instantly share code, notes, and snippets.

🎯
Living the JAMstack life.

Brandon Pittman brandonpittman

🎯
Living the JAMstack life.
Block or report user

Report or block brandonpittman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@brandonpittman
brandonpittman / Counter.php
Created Jul 29, 2019
Livewire Counter component
View Counter.php
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class Counter extends Component
{
public $count = 0;
@brandonpittman
brandonpittman / footer.antlers.html
Created Jul 26, 2019
Statamic is fucking sick.
View footer.antlers.html
@brandonpittman
brandonpittman / WithToggle.js
Created Jul 24, 2019
Keep that dumb toggle logic away from the presentation!
View WithToggle.js
export default {
render() {
return this.$scopedSlots.default({
isToggledOn: this.isToggledOn,
toggle: this.toggle,
})
},
data() {
return { isToggledOn: false }
},
View remark.vue
# Vue-Remark Sample
* Markdown
* `style` tags
* any JavaScript
<style scoped>
h1 {
@apply text-black bg-pink-300;
}
@brandonpittman
brandonpittman / aspect-wide.js
Created Jun 20, 2019
TailwindCSS component for flexible YouTube iframe container
View aspect-wide.js
plugins: [
function({ addComponents }) {
const aspects = {
'.aspect-wide': {
paddingBottom: '56.25%',
position: 'relative',
overflow: 'hidden',
'& > iframe': {
position: 'absolute',
top: 0,
@brandonpittman
brandonpittman / OpenAndComplete.js
Last active May 1, 2019
Things OpenAndComplete written in JS (v2)
View OpenAndComplete.js
function run(argv) {
var app = Application('Things3')
var currentApp = Application.currentApplication()
currentApp.includeStandardAdditions = true
var selected = app.selectedToDos()
if (selected.length !== 0) {
selected.forEach(todo => {
todo.completionDate = new Date()
@brandonpittman
brandonpittman / OpenAndComplete.applescript
Created Apr 30, 2019
Open and Complete for Things 3
View OpenAndComplete.applescript
on run
tell application "Things3"
repeat with todo in selected to dos
set completion date of todo to (current date)
set theNotes to notes of todo
repeat with todoParagraph in paragraphs of theNotes
if todoParagraph contains "://" then
do shell script "open " & quoted form of todoParagraph
end if
@brandonpittman
brandonpittman / WeeklyReview.js
Created Apr 17, 2019
Weekly Review in Things
View WeeklyReview.js
const Things = require('things-json').default
const showList = list => `things:///show?id=${list}`
const project = Things.project({
title: 'Weekly Review',
})
const todos = [
Things.todo({ title: 'Brain Dump' }),
@brandonpittman
brandonpittman / gridsome.config.js
Created Feb 23, 2019
New and improved gridsome.config.js
View gridsome.config.js
const cssvariables = require('postcss-css-variables')
const purgecss = require('@fullhuman/postcss-purgecss')
const tailwind = require('tailwindcss')
const postcssPlugins = [
cssvariables({ preserve: true }),
tailwind('./tailwind.js'),
]
if (process.env.NODE_ENV === 'production') postcssPlugins.push(purgecss())
@brandonpittman
brandonpittman / func.js
Created Jun 20, 2018
Vue.js render/functional component example
View func.js
import Vue from 'vue'
const Async = {
functional: true,
props: {
name: {
type: String
}
},
render (h, {props}) {
You can’t perform that action at this time.