Skip to content

Instantly share code, notes, and snippets.

View asha23's full-sized avatar
🎩
Working from home

Ash Whiting asha23

🎩
Working from home
View GitHub Profile
@asha23
asha23 / bower.json
Last active November 10, 2017 10:18
Quick and dirty gulp/bootstrap compiler
{
"name": "bower",
"description": "Gulp and sass bootstrap for collection",
"main": "index.js",
"authors": [
"awhiting"
],
"license": "ISC",
"homepage": "",
"ignore": [
@asha23
asha23 / mixins.scss
Created July 11, 2017 10:56
More mixins
////
/// mixins.scss
/// Mixins
/// @author Ash Whiting
////
/// Rems
/// @include fs(font-size, line-height)
@mixin fs($size:1.6, $line: $size){
@asha23
asha23 / index.pug
Created February 28, 2017 17:18
Voyager Timeline
- var voyagerTimeline = [{"date": "1977 Aug. 20", "description": "Voyager 2 launched from Kennedy Space Flight Center"}, {"date": "1977 Sept. 5", "description": "Voyager 1 launched from Kennedy Space Flight Center, Voyager 1 returns first spacecraft photo of Earth and Moon"}, {"date": "1979 Mar. 5", "description": "Voyager 1 makes its closest approach to Jupiter"}, {"date": "1979 July 9", "description": "Voyager 2 makes its closest approach to Jupiter"}, {"date": "1980 Nov. 12", "description": "Voyager 1 flies by Saturn, Voyager 1 begins its trip out of the Solar System"}, {"date": "1981 Aug. 25", "description": "Voyager 2 flies by Saturn"}, {"date": "1982", "description": "Deep Space Network upgrades two 26-m antennas to 34-m"}, {"date": "1986 Jan. 24", "description": "Voyager 2 has the first-ever encounter with Uranus, Deep Space Network begins expansion of 64-m antennas to 70-m"}, {"date": "1987", "description": "Voyager 2 'observes' Supernova 1987A"}, {"date": "1988", "description": "Voyager 2 returns fir
@asha23
asha23 / alert-delete.php
Created February 13, 2017 11:00
Advanced Custom Fields Row Delete Alert
// Fix for the field delete
add_action('acf/input/admin_head', 'my_acf_admin_head');
function my_acf_admin_head() {
?>
<script type="text/javascript">
(function($) {
@asha23
asha23 / flex-title.php
Created February 13, 2017 10:59
Advanced Custom Fields Flexible Content Type Rename Title
function my_layout_title($title, $field, $layout, $i) {
if($value = get_sub_field('layout_title')) {
return $value;
} else {
foreach($layout['sub_fields'] as $sub) {
if($sub['name'] == 'layout_title') {
$key = $sub['key'];
if(array_key_exists($i, $field['value']) && $value = $field['value'][$i][$key])
return $value;
}
@asha23
asha23 / wpinstall.sh
Created October 10, 2016 15:38
WP CLI bash script
#!/bin/bash -e
wpuser='awhiting'
clear
echo "================================================================="
echo "Quick Wordpress Installer"
echo "================================================================="
@asha23
asha23 / custom-post-type-feed.php
Created September 19, 2016 14:06
Wordpress - Adding a custom post type and categories to a news feed
<?php
/**
* Template Name: Custom RSS Template - Regulatory Resources Feed
*/
header('Content-Type: '.feed_content_type('rss-http').'; charset='.get_option('blog_charset'), true);
echo '<?xml version="1.0" encoding="'.get_option('blog_charset').'"?'.'>';
?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
@asha23
asha23 / quiz.js
Created September 2, 2016 11:48
Simple Quiz Script
var answers = [ false,true,false,true,true,false,true,true,false,true,true ]
$('form').submit(function(e) {
e.preventDefault();
var $el = $('#results'), errors=getIncorrectAnswers($('form').find('input'),answers);
if (errors.length==0) {
$('tr').removeClass("error");
$el.find("p:not(.error)").text("Congratulations, you got all 11 questions right!");
@asha23
asha23 / iframe-inside-bootstrap-3-modal.markdown
Created August 19, 2016 13:06
iFrame inside Bootstrap 3 modal