Skip to content

Instantly share code, notes, and snippets.

View tayvano's full-sized avatar

Taylor Monahan tayvano

View GitHub Profile
@tayvano
tayvano / .htaccess
Last active April 5, 2017 00:10 — forked from boogah/.htaccess
Expire headers .htaccess code.
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 3 days"
# Favicon
ExpiresByType image/x-icon "access plus 1 month"
# Media: images, video, audio
ExpiresByType image/gif "access plus 1 month"
@tayvano
tayvano / primary_category.php
Created March 17, 2017 00:58 — forked from jawinn/primary_category.php
Display Primary Category (Yoast's WordPress SEO)
<?php
// SHOW YOAST PRIMARY CATEGORY, OR FIRST CATEGORY
$category = get_the_category();
$useCatLink = true;
// If post has a category assigned.
if ($category){
$category_display = '';
$category_link = '';
if ( class_exists('WPSEO_Primary_Term') )

Keybase proof

I hereby claim:

  • I am tayvano on github.
  • I am tayvano (https://keybase.io/tayvano) on keybase.
  • I have a public key ASBa64mpsHMVdrXgqF_bPTqz7pZxKiudr_d_f-sVvfwDqQo

To claim this, I am signing this object:

@tayvano
tayvano / gist:6e2d456a9897f55025e25035478a3a50
Created February 19, 2017 05:29
complete list of ffmpeg flags / commands
Originall From: Posted 2015-05-29 http://ubwg.net/b/full-list-of-ffmpeg-flags-and-options
This is the complete list that’s outputted by ffmpeg when running ffmpeg -h full.
usage: ffmpeg [options] [[infile options] -i infile]… {[outfile options] outfile}…
Getting help:
-h — print basic options
-h long — print more options
-h full — print all options (including all format and codec specific options, very long)
# -----------------------------
# 2. MAKE TERMINAL BETTER
# -----------------------------
alias cp='cp -iv' # Preferred 'cp' implementation
alias mv='mv -iv' # Preferred 'mv' implementation
alias mkdir='mkdir -pv' # Preferred 'mkdir' implementation
alias ll='ls -FGlAhp' # Preferred 'ls' implementation
alias less='less -FSRXc' # Preferred 'less' implementation
@tayvano
tayvano / walletdecryptdrtv.js in html
Created February 3, 2017 05:14
walletdecryptdrtv.js in html
<article class="row" ng-controller='decryptWalletCtrl'>
<!-- Column 1 - Select Type of Key -->
<section class="col-md-4 col-sm-6">
<h4 translate="decrypt_Title"> Select the format of your private key: </h4>
<div class="radio"><label><input type="radio" ng-model="walletType" value="fileupload" /><span translate="x_Keystore2">Keystore / JSON File</span></label></div>
<div class="radio"><label><input type="radio" ng-model="walletType" value="pasteprivkey" /><span translate="x_PrivKey2">Private Key</span></label></div>
<div class="radio"><label><input type="radio" ng-model="walletType" value="pastemnemonic" /><span translate="x_Mnemonic">Mnemonic Phrase</span></label></div>
<div class="radio" ng-hide="globalService.currentTab==globalService.tabs.signMsg.id"><label><input type="radio" ng-model="walletType" value="ledger" />Ledger Nano S</label></div>
<div class="radio" ng-hide="globalService.currentTab==globalService.tabs.signMsg.id"><label><input type="radio" ng-model="walletType" valu
function limit_char($limit, $source=null) {
global $post;
($source) ? '<p>'.$source.'</p>' : $source = '<p>'.get_the_excerpt().'</p>';
$read_more = '... <a href="'. get_permalink($post->ID) . '" class="more-link" title="Read '.get_the_title($post->ID).'">Read more</a>';
$limited = strlen($source) > $limit ? substr($source,0,strpos($source,' ',$limit)) . $read_more : $source;
echo $limited;
}
// Smooth Scolling https://css-tricks.com/snippets/jquery/smooth-scrolling/
// the higher the "400" number is, the slower is goes.
$(function() {
$('a[href*=\\#]:not([href=\\#])').click(function(e) {
if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top - 110
@tayvano
tayvano / encoding-video.md
Created December 31, 2016 05:27 — forked from Vestride/encoding-video.md
Encoding Video for the web

Encoding Video

Installing

Install FFmpeg with homebrew. You'll need to install it with a couple flags for webm and the AAC audio codec.

brew install ffmpeg --with-libvpx --with-libvorbis --with-fdk-aacc --with-opus
@tayvano
tayvano / wp-query-ref.php
Last active April 21, 2017 07:15 — forked from luetkemj/wp-query-ref.php
WP: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/3.9/src/wp-includes/query.php
*/
$args = array(