Skip to content

Instantly share code, notes, and snippets.

View dylanized's full-sized avatar

Dylan Hassinger dylanized

View GitHub Profile
@dylanized
dylanized / gist:d742dc621e2dd12db622
Last active August 29, 2015 14:19
WPEngine command line sync function
function push_to_wpengine {
domain="sftp://"
user=""
password=""
localpath=""
remotepath="" # no initial slash
lftp $domain -u $user,$password -e "mirror --reverse -c --parallel=4 --delete --verbose --no-perms --exclude-glob .DS_Store '$localpath' $remotepath; bye"
function inject_footer() {
?>
<h6>This code gets injected into the footer</h6>
<?php
}
add_filter( 'wp_footer' , 'inject_footer' );
@dylanized
dylanized / gist:5489074
Created April 30, 2013 14:25
Errorface and edt example
/**
* Module dependencies.
*/
var express = require('express')
, routes = require('./routes')
, user = require('./routes/user')
, http = require('http')
, path = require('path')
@dylanized
dylanized / gist:5407367
Created April 17, 2013 20:12
Modified version of ejs.js, with "snippet" and "resolveSnippet" stubbed out
/*!
* EJS
* Copyright(c) 2012 TJ Holowaychuk <tj@vision-media.ca>
* MIT Licensed
*/
/**
* Module dependencies.
*/
@dylanized
dylanized / Sails + Jam
Last active December 16, 2015 06:38
Example of Sails.js package.json file with JamJS dependencies
{
"name": "sailsplus",
"private": true,
"version": "0.0.0",
"description": "a Sails application boilerplate",
"dependencies": {
"sails": "0.8.894",
"jam": null,
"moment": null
},
@dylanized
dylanized / milton.js
Created May 21, 2012 00:40
More JS Jokes
var stapler = {};
stapler.color = red;
stapler.find = function() {
var my_stapler = this;
$(everybody).each(function() {
this.ask("Have you seen" + my_stapler);
}
}
@dylanized
dylanized / comments.php
Created April 29, 2012 00:15
WordPress default comment template
<ol class="commentlist">
<li class="comment byuser comment-author-admin bypostauthor even thread-even depth-1" id="comment-2">
<div id="div-comment-2" class="comment-body">
<div class="comment-author vcard">
<img alt="" src="#" class="avatar avatar-32 photo" height="32" width="32">
<cite class="fn">admin</cite> <span class="says">says:</span>
</div>
@dylanized
dylanized / excerpt.php
Created April 24, 2012 23:13
Flexible WP Excerpt Snippet
<?php // outside the loop
// empty more text on custom excerpt
function custom_excerpt_more( $more ) {
return '';
}
add_filter( 'excerpt_more', 'custom_excerpt_more' );
// instantiate global excerpt string
$more_text = "Read More&hellip;";
@dylanized
dylanized / paypal_pdt
Created April 12, 2012 23:24
Paypal PDT Handling Script, slightly cleaned up
<?php
// PayPal PDT code
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-synch';
$tx_token = $_GET['tx'];
$auth_token = "YOUR TOKEN GOES HERE";
$req .= "&tx=$tx_token&at=$auth_token";