Skip to content

Instantly share code, notes, and snippets.

Joe di Stefano joeydi

Block or report user

Report or block joeydi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@joeydi
joeydi / post-receive.sh
Created Sep 24, 2019
Craft CMS post-receive hook
View post-receive.sh
#!/bin/bash
WORK_TREE="/var/www/example"
GIT_DIR="/var/repo/example.git"
BRANCH="master"
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [ "$ref" = "refs/heads/$BRANCH" ];
then
@joeydi
joeydi / installwp.sh
Created Oct 20, 2018
Download WordPress, Create Database, and Install - Requires WP CLI
View installwp.sh
#!/bin/bash
# Download WordPress, create database, configure, and install
if [ $1 ]
then
echo "Installing in directory $1"
mkdir $1
cd $1
@joeydi
joeydi / views.py
Created Jun 10, 2016
Form/FormSet cleaned_data handling
View views.py
if isinstance(cleaned_data, list):
cleaned_data = [self.process_cleaned_data(form_data) for form_data in cleaned_data]
else:
cleaned_data = self.process_cleaned_data(cleaned_data)
@joeydi
joeydi / batch.py
Created Nov 19, 2014
Simple WordPress Content Scraper/Importer
View batch.py
import os
import lxml.html
import urllib
import BeautifulSoup
from pprint import pprint
from wordpress_xmlrpc import Client, WordPressPage
from wordpress_xmlrpc.methods.posts import GetPosts, NewPost
from wordpress_xmlrpc.methods.users import GetUserInfo
View Example Open Graph Tags
<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 Nov 15, 2017
WordPress SEO Open Graph Image Size Filter
View functions.php
<?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 Sep 25, 2014
Attempt to play video frame by frame with scroll. Don't try this at home, kids.
View skrollr-video.js
videos.each(function () {
var video = $(this).get(0);
video.addEventListener('loadedmetadata', function () {
console.log(video.duration);
});
});
skrollr.init({
render: function(data) {
View uptime.py
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
View vpr-composer
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 Aug 19, 2014
Front Porch Forum Suggestions
View fpf-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 ;)
You can’t perform that action at this time.