Skip to content

Instantly share code, notes, and snippets.

View tburry's full-sized avatar

Todd Burry tburry

View GitHub Profile
@tburry
tburry / blog-feed.html
Created August 17, 2018 15:38
Sample blog feed HTML
<ul class="rssFeed">
<li class="rssFeed-item">
<h3 class="rssFeed-title"><a href="https://blog.vanillaforums.com/rich-editor-enhancing-your-forum-posting-experience">Rich Editor: Enhancing Your Forum Posting Experience</a></h3>
<div class="hs-featured-image-wrapper"> <a href="https://blog.vanillaforums.com/rich-editor-enhancing-your-forum-posting-experience" title="" class="hs-featured-image-link"> <img src="https://blog.vanillaforums.com/hubfs/New%20Rich%20Editor%20-%20Todd%20-%20Adam%20-%20Adrian%20-%201.jpg?t=1534448727065" alt="New Rich Editor - Todd - Adam - Adrian - 1" class="hs-featured-image" style="width:auto !important; max-width:50%; float:left; margin:0 15px 15px 0;"> </a> </div> <p><span style="font-weight: 400;">After many months of development, we are very excited to unveil a new Rich Editor, an enhanced WYSIWYG &nbsp;(what you see is what you get) experience. This project has been the culmination of much work amongst several developers on our team and we are so happy to finally share
@tburry
tburry / formatting.md
Created February 12, 2018 17:11
Formatting Examples

A simple function would look like:

function foo(array $bar) {
    foreach ($bar as $key => $value) {
        echo "$key: $value\n";
    }
}
@tburry
tburry / log-levels.md
Last active April 3, 2017 19:02
Emoji log levels
level
⚙️ debug
ℹ️ info
🔔 notice
⚠️ warning
🛑 error
💥 critical
🚨 alert
🚑 emergency
@tburry
tburry / hatml.md
Last active March 28, 2017 16:20
The Hatml Template Language

The Hatml Template Language

HTML Attribute Template Markup Language

The hatml templating language uses basic HTML and special attributes for a simple yet powerful templating language.

Basic Templating

In general you write normal HTML. Data is included in the template by including it between {...}. Other special functionality is added via special template attributes.

@tburry
tburry / vanilla-developer-articles.md
Last active August 30, 2017 21:02
Vanilla Developer Reading List

Vanilla Developer Reading List

Although we abstract away PDO in most cases it's good to know about how it works. You will be interacting directly with PDO from time to time and there are some things you should know (spoiler: setting a few defaults is necessary).

We want to develop features with an API-first mentality. Everyone developing for Vanilla should undersdand how to design a RESTful API endpoint so that we can have a common language for feature design.

@tburry
tburry / counts.sql
Last active June 1, 2016 15:26
Update database counts in Vanilla.
-- Count discussions.
update GDN_Category c
set CountDiscussions = (select coalesce(count(d.DiscussionID), 0) from GDN_Discussion d where c.CategoryID = d.CategoryID);
-- Count comments.
update GDN_Discussion d
set CountComments = (select coalesce(count(c.CommentID), 0) from GDN_Comment c where c.DiscussionID = d.DiscussionID);
update GDN_Category c
set CountComments = (select coalesce(sum(d.CountComments), 0) from GDN_Discussion d where c.CategoryID = d.CategoryID);
@tburry
tburry / cla.md
Created May 2, 2016 18:55
Vanilla Forums' contributor license agreement.

Vanilla Forums Contributor License Agreement

These terms apply to your contribution of materials to a product or project owned or managed by us ('project'), and set out the intellectual property rights you grant to us (Vanilla Forums Inc) in the contributed materials. If this contribution is on behalf of a company, the term 'you' will also mean the company for which you are making the contribution. If you agree to be bound by these terms, check the box below.

Read this agreement carefully before agreeing.

  1. The term 'contribution' means any source code, object code, patch, tool, sample, graphic, specification, manual, documentation, or any other material posted or submitted by you to a project.

  2. With respect to any worldwide copyrights, or copyright applications and registrations, in your contribution:

@tburry
tburry / php-lint.sh
Created November 16, 2015 20:27
Lint a directory tree of PHP files.
#!/bin/bash
me=`basename $0`
if [ $# -lt 1 ]; then
echo "Usage: $me [-q] <folder>"
exit 1;
fi
quick=false
if [ "$1" = "-q" ]; then
@tburry
tburry / git-normalize-lines.sh
Created May 29, 2015 18:59
Normalize all line endings in the current git repo to the config setting.
# Normalize all line endings in the current repo to the config setting.
git rm --cached -rf .
git diff --cached --name-only -z | xargs -n 50 -0 git add -f
@tburry
tburry / composer-bin-autoload.php
Last active May 16, 2019 09:46
A snippet for including your composer autoloader in your /bin files.
<?php
$paths = [
__DIR__.'/../vendor/autoload.php', // locally
__DIR__.'/../../../autoload.php' // dependency
];
foreach ($paths as $path) {
if (file_exists($path)) {
require_once $path;
break;