Skip to content

Instantly share code, notes, and snippets.

View dansully's full-sized avatar

Dan Sullivan dansully

View GitHub Profile
@dansully
dansully / createCredential.py
Created May 17, 2025 13:29 — forked from ongeelim/createCredential.py
Daily Timelapse Video Capture and Upload to Youtube
#!/usr/bin/python
# Note that if you're using Youtube Data API 3 for testing/internal use (and not production purposes), the credentials can only last
# for a week, so be sure to update credentials every week by running this python script
# You can either:
# - Run this script on personal computer to generate credentials.json, and then copy that file to your Raspberry Pi remotely, or
# - Run this script on Raspeberry Pi remotely via VNC (Do not use remote SSH as running this script will automatically launch browser for
# Google re-authentication) to generate credentials.json
import json
@dansully
dansully / shortcode_post_object.php
Created May 15, 2018 21:56 — forked from phucdohong96/shortcode_post_object.php
Shortcode Sample ACF Post Object & ACF Repeater
<?php
function shortcode_post_object_function() {
ob_start();
$count = 0;
//Get field
$post_objects = get_field ('post_objects');
if (!empty($post_objects)) {
foreach ($post_objects as $post_object) {
$id = $post_object->ID;
@dansully
dansully / acf_field.php
Created May 15, 2018 21:55 — forked from badabingbreda/acf_field.php
Shortcode to echo ACF field inline
<?php
/**
* function that will generate the shortcode's output
* @param array $atts
* @return string $output
*/
function func_div_myshortcode( $atts ) {
$atts = shortcode_atts(
array()
@dansully
dansully / image-array.php
Created September 20, 2017 18:36 — forked from aibrean/image-array.php
Demystifying the ACF image field. ACF (Advanced Custom Fields) allows users to use an ID, array, or URL for images. Once the field is set up in ACF, it’s up to you to get it to work correctly in your template/theme. This is known as the “return value” in ACF.
<?php
$image = get_field('image'); // assigns the image field to the variable of $image
if( !empty($image) ){ ?> <!-- if the $image variable isn't empty, display the following: -->
<img src="<?php echo $image['url']; ?>" alt="<?php echo $image['alt']; ?>" /> <!--displays the URL for the image variable and also the alt tag which is entered in the WordPress media library-->
<?php }; ?> <!--ends the if statement -->
@dansully
dansully / columns.css
Created August 30, 2017 21:06 — forked from studiopress/columns.css
Genesis column classes.
/* Column Classes
Link: http://twitter.github.io/bootstrap/assets/css/bootstrap-responsive.css
--------------------------------------------- */
.five-sixths,
.four-sixths,
.one-fourth,
.one-half,
.one-sixth,
.one-third,
@dansully
dansully / bootstrap-genesis-structural-wraps.php
Created April 19, 2017 20:07 — forked from bryanwillis/bootstrap-genesis-structural-wraps.php
Adding genesis-structural-wrap-support to Bootstrap Genesis
<?php
/**
* Module: Bootstrap Genesis Plugin - Structural Wraps
* Author: Bryan Willis
*/
/**
* Add theme support for structural wraps
*/
function gb3_add_theme_support_structural_wraps() {
@dansully
dansully / Navigation.php
Created March 7, 2017 19:10 — forked from aaroneaton/Navigation.php
Using the Zurb Foundation Top Bar with WordPress menus
<?php
class Navigation {
public function __construct() {
// Move the navigation to the header element
remove_action( 'genesis_after_header', 'genesis_do_nav' );
remove_action( 'genesis_site_title', 'genesis_seo_site_title' );
// remove_action( 'genesis_header', )
@dansully
dansully / 0_reuse_code.js
Last active August 29, 2015 14:24
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
@dansully
dansully / app.js
Last active August 29, 2015 14:16 — forked from rewonc/app.js
//*
//* See the JS Fiddle: http://jsfiddle.net/sxcjmoj5/3/
//*
//*
// make sure ngSanitize module is installed:
// https://docs.angularjs.org/api/ngSanitize
//
// To convert links from plaintext, you must use the linky filter which is included with ngSanitize
// https://docs.angularjs.org/api/ngSanitize/filter/linky
//
// Photoshop Script to Create iPhone Icons from iTunesArtwork
//
// WARNING!!! In the rare case that there are name collisions, this script will
// overwrite (delete perminently) files in the same folder in which the selected
// iTunesArtwork file is located. Therefore, to be safe, before running the
// script, it's best to make sure the selected iTuensArtwork file is the only
// file in its containing folder.
//
// Copyright (c) 2010 Matt Di Pasquale
// Added tweaks Copyright (c) 2012 by Josh Jones http://www.appsbynight.com