Skip to content

Instantly share code, notes, and snippets.

View joeydi's full-sized avatar

Joe di Stefano joeydi

View GitHub Profile
<meta property="og:type" content="article" />
<meta property="og:title" content="Web Design & Development from Burlington, VT - Okay Plus" />
<meta property="og:description" content="Critical thinking, clean code and responsive design. These are the tools I use to bring digital experiences to life online." />
<meta property="og:url" content="http://okaypl.us/" />
<meta property="og:site_name" content="Okay Plus" />
@joeydi
joeydi / functions.php
Last active November 15, 2017 14:27
WordPress SEO Open Graph Image Size Filter
<?php
function my_opengraph_image_size() {
return 'large';
}
add_filter( 'wpseo_opengraph_image_size', 'my_opengraph_image_size', 10, 1 );
@joeydi
joeydi / skrollr-video.js
Created September 25, 2014 13:31
Attempt to play video frame by frame with scroll. Don't try this at home, kids.
videos.each(function () {
var video = $(this).get(0);
video.addEventListener('loadedmetadata', function () {
console.log(video.duration);
});
});
skrollr.init({
render: function(data) {
from threading import Thread
import requests ## pip install requests
import time
import smtplib
## email sending function
def email_sender(input_message, email_to, client):
''' function to send email '''
to = email_to
gmail_user = '' ## email of sender account
initComposer = function() {
if (window.XMLHttpRequest) {
httpRequest = new XMLHttpRequest();
} else if (window.ActiveXObject) {
try {
httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
}
catch (e) {
try {
httpRequest = new activeXObject("Microsoft.XMLHTTP");
@joeydi
joeydi / fpf-suggestions
Created August 19, 2014 19:41
Front Porch Forum Suggestions
- Even when logged in, the homepage shows the signup form. This would be much more useful if it showed the current issue.
- On the current issue on mobile, there is 3 full screens of navigation cruft before you get to the first post.
- Fix broken layouts on mobile.
- Ability to attach pictures or other media to posts.
- Ability to reply to a post.
- Ability to see replies to a post.
- Fewer posts about cats ;)
@joeydi
joeydi / sprite-animation.js
Last active August 29, 2015 13:56
Animation with javscript and a vertical sprite of animation frames.
Today.page_turn_forward = function () {
var y = 322,
i = 0,
frame_count = 27,
frame = $('.anim-frame'),
interval;
frame.show()
// Start position
@joeydi
joeydi / locations.csv
Last active December 28, 2015 10:49
Import a csv of location data into Wordpress. Data is formatted to work with the SimpleMap plugin. Depends on the wordpress_xmlrpc and pygeocoder libraries.
Category Type Name Address City Zip Code Phone Number URL
General Bank Chase Bank 36132 Hidden Springs Rd Wildomar 92595 (951) 678-9231 https://www.chase.com/
Public Services Fire Station Station 61 32637 Gruwell St. Wildomar 92595 951-246-2337 http://cityofwildomar.org
Entertainment Museum Temecula Valley Museum 28314 Mercedes St Temecula 92592 (951) 694-6450 http://temeculavalleymuseum.com/
@joeydi
joeydi / functions.php
Last active December 25, 2015 17:59
Redirect mobile users in Wordpress
<?php
function is_mobile() {
$is_mobile = (bool)preg_match( '#\b(ip(hone|od)|android\b.+\bmobile|'.
'opera m(ob|in)i|windows (phone|ce)|blackberry|s(ymbian'.
'|eries60|amsung)|p(alm|rofile/midp|laystation portable'.
')|nokia|fennec|htc[\-_]|up\.browser|[1-4][0-9]{2}x[1-4]'.
'[0-9]{2})\b#i', $_SERVER['HTTP_USER_AGENT'] );
return $is_mobile;
}
<?php
/**
* Given a string containing any combination of YouTube and Vimeo video URLs in
* a variety of formats (iframe, shortened, etc), each separated by a line break,
* parse the video string and determine it's valid embeddable URL for usage in
* popular JavaScript lightbox plugins.
*
* In addition, this handler grabs both the maximize size and thumbnail versions
* of video images for your general consumption. In the case of Vimeo, you must
* have the ability to make remote calls using file_get_contents(), which may be