Skip to content

Instantly share code, notes, and snippets.

View shawnsandy's full-sized avatar

Shawn Sandy shawnsandy

View GitHub Profile
@shawnsandy
shawnsandy / HTML5 template
Created May 10, 2020 18:17
Heml 5 templates
{
"generate html5 (basic) template": {
"prefix": "html5",
"body": [
"<!doctype html>",
"",
"<html lang=\"en\">",
"<head>",
" <meta charset=\"utf-8\">",
"",
@shawnsandy
shawnsandy / profiles.json
Last active February 22, 2020 18:56
Windows Terminal
// To view the default settings, hold "alt" while clicking on the "Settings" button.
// For documentation on these settings, see: https://aka.ms/terminal-documentation
{
"$schema": "https://aka.ms/terminal-profiles-schema",
"defaultProfile": "{00000000-0000-0000-ba54-000000000002}",
"profiles": {
"defaults": {
@shawnsandy
shawnsandy / .bashrc
Last active February 22, 2020 12:12
Aliases -- git bash windows to
alias ls='ls -alh'
alias cdmongodata='cd /c/mongodb/data/db && ls'
alias sbrc='cd ~ && source .bashrc'
alias mydocs='cd ~/Documents'
alias dev='cd ~/devbox'
# Aliases
alias g='git'
alias gst='git status'
alias gd='git diff'
alias gdc='git diff --cached'

Bootstrap Mega Menu

A mega menu implementation using Bootstrap (unfinished - how can the indicator be positioned on the active top-level item without the relative positioning?)

A Pen by Jon Reece on CodePen.

License.

@shawnsandy
shawnsandy / index.html
Created April 10, 2018 02:26
Wavy Loading Animations
<div class="header">
<h1>Wavy Loading Animations</h1>
<h4>By: <a href="http://kylebrumm.com" target="_blank">Kyle Brumm</a></h4>
</div>
<div class="shaft-load">
<div class="shaft1"></div>
<div class="shaft2"></div>
<div class="shaft3"></div>
<div class="shaft4"></div>
@shawnsandy
shawnsandy / cpt_class.php
Created November 28, 2012 19:04
Custom post type class
<?php
/**
* @package WordPress
* @subpackage Core-WP
* @author shawnsandy
*/
class cwp_post_type {
/*
* post vars
@shawnsandy
shawnsandy / example-umbrella.js
Created June 2, 2017 23:40
Simple example to hide display forms
u(".widget-forms").each(function (el, i) {
console.log(el);
var button = u(el).find('.tag-button');
var frm = u(el).find('.hide-tags');
console.log(frm);
u(button).on('click', function () {
console.log(u(button).text());
u(frm).toggleClass("bluform");
@shawnsandy
shawnsandy / component-example.php
Last active March 15, 2017 14:25
Laravel components
<?php
/*
* $data = dataset mixed|array|string required
* $title = component title string
* $attributes html attributes
* $view blade template optional
* */
Html::component("component_name", "dash::components.test", ["data", 'title' => 'Title', "attributes" => [], 'view']);
@shawnsandy
shawnsandy / default_thumbnail.php
Created November 18, 2012 02:13
How to define a default post thumbnail....
function default_thumbnail($html) {
global $_wp_additional_image_sizes;
$isize = $_wp_additional_image_sizes;
$w = $isize['post-thumbnail']['width'];
$h = $isize['post-thumbnail']['height'];
if (empty($html)) {
$html = '<figure class="default-post-thumbnail">';
$html .= '<img src="http://placehold.it/'.$w.'x'.$h.'" alt="" />';
$html .='</figure>';
}
@shawnsandy
shawnsandy / confirm-delete-button.js
Last active March 14, 2017 20:35
Jquery Toggle Elements
$(".delete-success").click(function (e) {
var btn = $(this);
if ($(this).text() == "Delete") {
e.preventDefault();
$(this).html("<i class=\"fa fa-times\"></i>Confirm");
setTimeout(function() {
console.log(btn);
$(btn).text("Delete")