Skip to content

Instantly share code, notes, and snippets.

View jstnbr's full-sized avatar

Justin Breen jstnbr

View GitHub Profile
@jstnbr
jstnbr / 0_reuse_code.js
Created November 9, 2016 21:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
/**
* easyListSplitter 1.0.2
* Copyright (c) 2010 Andrea Cima Serniotti (http://www.madeincima.eu)
* Dual licensed under MIT and GPL
*/
/**
* Usage:
*
@jstnbr
jstnbr / Custom Excerpt.php
Created February 26, 2018 05:31
Generate a custom excerpt in Wordpress.
<?php
/**
* Custom Excerpt
*
* @param array $args {
* Optional. Array of excerpt() arguments.
*
* @type int $limit Limit result to amount. Default '55'.
* @type string $limitby Limit by either word or character. Default 'word'. Accepts 'char', 'word'.
@jstnbr
jstnbr / open-graph-protocol-head-info.php
Created June 22, 2018 18:06
Setup Open Graph Protocol data by adding this code to the document head.
<?php if ( has_post_thumbnail() ) : ?>
<meta property="og:image" content="<?php echo get_the_post_thumbnail_url( get_the_ID(), 'large' ); ?>">
<meta property="og:image:secure_url" content="https://newportshimodablackships.com/wp-content/uploads/2018/06/lanterns-background-1200x630.jpg">
<meta property="og:image:type" content="image/jpeg">
<meta property="og:image:width" content="1200">
<meta property="og:image:height" content="630">
<meta property="og:image:alt" content="<?php the_title(); ?> - <?php bloginfo( 'name' ); ?>">
<?php endif; ?>
@jstnbr
jstnbr / wordpress-dev.sh
Created June 1, 2019 16:37 — forked from techkram/wordpress-dev.sh
WordPress Development Script
# wordpress-dev.sh
#
# Copyright 2012 Frank Lewandowski <franky@techkram.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@jstnbr
jstnbr / wp-start.sh
Created June 1, 2019 17:29 — forked from ethicka/wp-start.sh
WordPress Installation with the Roots/Sage Framework and VirtualHost Creation
#!/bin/bash -e
##
# WordPress Installation and VirtualHost Creation
#
# Description: Installs a WordPress website in the ~/Sites folder, creates a homepage,
# cleans up the WP install a bit, deletes the akismet and hello dolly plugins, creates the permalinks,
# clones the roots/sage theme framework to the theme folder, deletes all the other WP default themes,
# installs/runs npm and bower and runs gulp to create the initial assets, adds a custom gitignore file
# to /wp-content, installs the roots/soil plugin, creates a git repo in wp-content, saves the WordPress
@jstnbr
jstnbr / gist:2a2ad16e1547fa6d833d00b3eac36f10
Created July 13, 2019 17:09 — forked from khakimov/gist:3558086
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@jstnbr
jstnbr / gmail-animation.html
Created September 26, 2019 11:38 — forked from hteumeuleu/gmail-animation.html
The new Gmail loading animation is just HTML and CSS.
<style>
body{margin:0;width:100%;height:100%} body,td,input,textarea,select{font-family:arial,sans-serif} input,textarea,select{font-size:100%} #loading{position:absolute;width:100%;height:100%;z-index:1000;background-color:#fff} .msg{ color: #757575; font: 20px/20px Arial, sans-serif; letter-spacing: .2px; text-align: center } #nlpt{ animation: a-s .5s 2.5s 1 forwards; background-color: #f1f1f1; height: 4px; margin: 56px auto 20px; opacity: 0; overflow: hidden; position: relative; width: 300px } #nlpt::before{ animation: a-lb 20s 3s linear forwards; background-color: #db4437; content: ''; display: block; height: 100%; position: absolute; transform: translateX(-300px); width: 100% } @keyframes a-lb{ 0%{transform:translateX(-300px)}5%{transform:translateX(-240px)}15%{transform:translateX(-30px)}25%{transform:translateX(-30px)}30%{transform:translateX(-20px)}45%{transform:translateX(-20px)}50%{transform:translateX(-15px)}65%{transform:translateX(-15px)}70%{transform:translateX(-10px)}95%{transform:translateX(-1
@jstnbr
jstnbr / gitcom.md
Created October 21, 2019 05:23 — forked from jednano/gitcom.md
Common git commands in a day-to-day workflow

Git Cheat Sheet

Initial Setup

Create an empty git repo or reinitialize an existing one

$ git init
@jstnbr
jstnbr / .gitignore
Created October 22, 2019 15:42 — forked from esamattis/.gitignore
.gitignore file for WordPress - Bare Minimum Git
# -----------------------------------------------------------------
# .gitignore for WordPress
# Bare Minimum Git
# http://ironco.de/bare-minimum-git/
# ver 20150227
#
# This file is tailored for a WordPress project
# using the default directory structure
#
# This file specifies intentionally untracked files to ignore