Skip to content

Instantly share code, notes, and snippets.

View ciccarone's full-sized avatar
:octocat:

Tony Ciccarone ciccarone

:octocat:
View GitHub Profile
.logo-items {
display: grid;
text-align: center;
grid-template-columns: 1fr 1fr 1fr;
align-items: center;
}
display: grid;
text-align: center;
grid-template-columns: 1fr 1fr 1fr;
jQuery(document).ready(function( $ ) {
var linetypes = new Array();
var items = new Array();
var subitems = new Array();
$('.specs tr').each(function() {
if(linetypes.indexOf($(this).data('linetype')) === -1){
linetypes.push($(this).data('linetype'));
}
if(items.indexOf($(this).data('item')) === -1){
// Smooth Scroll Anchors
$('a[href*="#"]:not([href="#"])').click(function() {
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
}, 1000);
return false;
php artisan migrate:refresh; php artisan migrate:reset; php artisan migrate;
export PATH=/usr/local/php5/bin:$PATH
@ciccarone
ciccarone / GTM UTM Link Click Data Variable
Created October 18, 2019 01:28
GTM UTM Link Click Data Variable
@ciccarone
ciccarone / Reddit: Post Bot
Created May 4, 2019 20:41
Been learning some python, here is a bot that posts to reddit using praw
import praw
import re
import time
reddit = praw.Reddit(
client_id='',
client_secret='Y',
user_agent='<console:testbot:0.0.1>',
username='',
password=''
php artisan create:resources Post --with-migration;
@ciccarone
ciccarone / WordPress function to automatically add ALT tags to images on upload
Last active April 5, 2023 11:13
Automatically add ALT tags to images uploaded to Wordpress media library based off of the file name.
// WordPress function to automatically
// add ALT tags to images on upload.
function alt_tag_adder( $post_ID ) {
if ( wp_attachment_is_image( $post_ID ) ) {
$tc_title = get_post( $post_ID )->post_title;
$tc_title = preg_replace( '%\s*[-_\s]+\s*%', ' ', $tc_title );
$tc_title = ucwords( strtolower( $tc_title ) );
$tc_meta = array(
'ID' => $post_ID,
@ciccarone
ciccarone / wp-hierarchical-taxonomy.php
Last active April 5, 2023 11:12
Programmatically add hierarchical taxonomies in Wordpress
$taxonomy_term = 'example';
$related_terms = array(
__( 'Parent' ) => array(
__( 'Child 1' ),
__( 'Child 2' ),
),
__( 'Parent 2') => array(
__( 'Child 3' ),
__( 'Child 4' ),