Skip to content

Instantly share code, notes, and snippets.

View jackmcdade's full-sized avatar
🌴
🏝

Jack McDade jackmcdade

🌴
🏝
View GitHub Profile
@jackmcdade
jackmcdade / Hydratable.vue
Created August 10, 2016 20:29
Vue/Laravel Server Side Preloading
<script>
export default {
props: {
endpoint: {
type: [String, Boolean],
default: false
},
preloaded: {
type: Boolean,
default: false
[{"name":"organizations","color":"Green","position":{"x":97,"y":97},"increment":true,"timestamp":true,"softdelete":true,"column":[],"relation":[],"seeding":[]}]
@jackmcdade
jackmcdade / schema.json
Created May 6, 2016 17:46
Statamic v2 Import Schema
{
"taxonomies": {
"categories": ["category_one", "category_two"],
"tags": ["tag_one", "tag_two"],
"foo": ["foo_one", "foo_two"],
},
"settings": {
"site_url": "http://mysite.com",
<?php
/**
* Modifier_sluggy
* Strips out comas and then replaces non-letter-characters in a variable with a separator
*/
class Modifier_more_sluggy extends Modifier
{
public function index($value, $parameters=array()) {
$separator = array_get($parameters, 0, '-');
title: Page
include:
- meta
fields:
_template:
display: Template
type: templates
header_image:
@jackmcdade
jackmcdade / mod.actually_truncate.php
Created January 16, 2015 19:05
Workaround for truncate ellipsis
<?php
/**
* Modifier_truncate
* Truncates the value of a variable
*
* @author Jack McDade
* @author Fred LeBlanc
* @author Mubashar Iqbal
*/
class Modifier_actually_truncate extends Modifier
@jackmcdade
jackmcdade / gist:0768caa59ae15cf2888b
Created August 25, 2014 17:23
Parse out email addresses
function extractEmailAddresses($string)
{
preg_match_all("/[\._a-zA-Z0-9-]+@[\._a-zA-Z0-9-]+/i", $string, $matches);
return $matches[0];
}
@jackmcdade
jackmcdade / post.md
Last active August 29, 2015 14:01
A travel blog post
title author temp main_photo city clouds
Sunny Positano
jen
64
/assets/img/italy/positano/day-three/header.jpg
Positano
sunny

After an all-too-early wake up call from the boys, we glanced out the windows and lo and behold...the SUN! We jumped out of bed not wanting to miss precious seconds or the ability to see the real colors of Positano! We gobbled down a messy breakfast, scrambled a few belongings together, jammed Liam in the carrier backpack, and made the 318 stair journey down to the bus stop. Bus tickets are cheaper (1.20 € vs 1.60 €) when purchased at a tabacchini (essentially a convenience store), so we snagged a pair and we were shortly on our way down the one-way loop of Positano as the bus navigated impossible corners and tight squeezes making us look at each other with wide eyes and nervously laugh!

@jackmcdade
jackmcdade / gist:9914826
Created April 1, 2014 14:09
My Sublime Text settings
{
"caret_extra_width": 1,
"caret_style": "phase",
"color_scheme": "Packages/User/Deep Blue See (SL).tmTheme",
"enable_tab_scrolling": false,
"font_size": 12.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
@jackmcdade
jackmcdade / parallax.js
Created January 23, 2014 16:46
parallax js
// Just a little vertical parllax goodness.
// You can play with the offsets for a more dramatic effect if you'd like.
$(function() {
var $window = $(window);
if ($window.width() > 640) {
$('.parallax').each(function() {
var self = $(this);
$(window).scroll(function() {