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 / watermark.fish
Created Sep 4, 2019
Pass a glob into this function to quickly add a basic watermark of the filename
View watermark.fish
function watermark
for file in $argv
convert $file -font Arial -pointsize 20 -draw "gravity south fill black text 0,12 '$file' fill white text 1,11 '$file' " converted-$file
end
end
View tailwind-transforms.css
a::after {
@apply scale-y-0 content-none w-full absolute bottom-0 left-0 -mb-2 h-1 rounded-full bg-white transition-transform transition-fast ease-in-out origin-bottom;
}
a:hover::after,
.active--exact::after {
@apply scale-y-100;
}
@brandonpittman
brandonpittman / LazyTube.vue
Created Aug 20, 2019
Lazy-load YouTube embeds w/fallback (assumes TailwindCSS)
View LazyTube.vue
<template>
<div :class="initialWidth">
<div v-if="src" class="aspect-wide z-10">
<iframe
ref="video"
width="560"
height="315"
:data-src="filledSrc"
:class="rounded"
class="w-full"
@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
You can’t perform that action at this time.