Skip to content

Instantly share code, notes, and snippets.

@austinpray
austinpray / AdventureTime.csv
Last active December 11, 2023 03:31
List of important adventure time episodes
Season Episode Title Reason
1 5 The Enchiridion A good intro to the series, plus introduces the important Enchiridion
1 8 Business Time* First mention of Ooo being post-apocalyptic
1 9 My Two Favorite People Intros the Jake and LR plotline
1 10 Memories of Boom Boom Mountain A look at how Finn was adopted into Jake's Family
1 12 Evicted! Intros Marceline
1 16 Ocean of Fear Introduces Finn's phobia
1 22 Henchman* Establishes Finn and Marceline as friends
1 23 Rainy Day Daydream* good episode to show someone who’s never seen the show before
1 25 His Hero introduces the Lich and Billy
@austinpray
austinpray / zepto.smoothScroll.js
Last active October 22, 2021 20:27
Zepto.js smooth vertical scrolling method. Implementing this code turns all anchor links with the class "scrollTo" into smooth scrolling anchor links. Rework of the foundation.js library method.
function smoothScroll(el, to, duration) {
if (duration < 0) {
return;
}
var difference = to - $(window).scrollTop();
var perTick = difference / duration * 10;
this.scrollToTimerCache = setTimeout(function() {
if (!isNaN(parseInt(perTick, 10))) {
window.scrollTo(0, $(window).scrollTop() + perTick);
smoothScroll(el, to, duration - 10);
@startuml
actor frizzle
actor sakura
actor xiaoruan
actor yukito
actor toya
actor rika
actor teacher
database cake
#!/usr/bin/env ruby
versions = (3..7).map{ |minor| "2.#{minor}" }
versions.each do |version|
cmd = <<~HERE
$stdout.write "defined?(DidYouMean) == "
$stdout.write defined?(DidYouMean).inspect
$stdout.write "\\n"
$stdout.write "defined?(DidYouMean::Levenshtein) == "
@austinpray
austinpray / out.txt
Created July 9, 2020 22:46
parse props from structured loggin
{"query"=>"can contain spaces", "span"=>"1h"}
{"query"=>"can contain spaces", "span"=>"1h"}
{"query"=>"can contain spaces", "span"=>"1h"}
{"query"=>"can contain spaces", "span"=>"1h"}
{"query"=>"can contain spaces"}
{"query"=>"can contain spaces"}
{"query"=>"can contain spaces"}
{"span"=>"1h"}
{"span"=>"1h"}
{"span"=>"1h"}
Balanced B (B-tier stupid and horny)
VS
Balanced C (C-tier stupid and horny)
#### Balanced B (B-tier stupid and horny)
Nature | Value | Stat | Value
------ | --- | ---- | ---
**stupid** | 4 | **HP** | 60
This file has been truncated, but you can view the full file.
Balanced F (F-tier stupid and horny)
VS
Balanced S (S-tier stupid and horny)
#### Balanced F (F-tier stupid and horny)
Nature | Value | Stat | Value
------ | --- | ---- | ---
**stupid** | 2 | **HP** | 37
@austinpray
austinpray / repairDropbox.sh
Created August 17, 2014 17:04
Fix Dropbox permissions
#!/bin/bash
sudo chflags -R nouchg ~/Dropbox ~/.dropbox ~/.dropbox-master
sudo chown "$USER" "$HOME"
sudo chown -R "$USER" ~/Dropbox ~/.dropbox ~/.dropbox-master
sudo chmod -RN ~/.dropbox ~/Dropbox ~/.dropbox-master
chmod -R u+rw ~/Dropbox ~/.dropbox ~/.dropbox-master
{
"repositories": [
{
"type": "package",
"package": {
"name": "zzzzz/no-trailing-comma",
"description": "Placeholder package for clean diffs in composer.json.",
"version": "1.0.0",
"type": "metapackage",
"license": "MIT",
@austinpray
austinpray / the-events-calendar-automatic-ticket-categories.php
Created June 20, 2019 15:03 — forked from MWDelaney/the-events-calendar-automatic-ticket-categories.php
Automatically apply "tribe_events_cat" taxonomy terms to WooCommerce tickets when tickets are saved or updated.
<?php
// Apply product categories to newly created or saved tickets that match the The Events Calendar categories of the associated event
add_action('event_tickets_after_save_ticket', function ($event_id, $ticket, $raw_data, $classname) {
if (empty($ticket) || !isset($ticket->ID)) {
return;
}
// Apply the "event-tickets" category to add tickets so that all tickets have at least this category to start
wp_add_object_terms($ticket->ID, 'event-tickets', 'product_cat');