Skip to content

Instantly share code, notes, and snippets.

View DrewDouglass's full-sized avatar
🤠

Drew Douglass DrewDouglass

🤠
View GitHub Profile
@timstl
timstl / maybe_ssl_url
Created August 22, 2014 14:17
maybe_ssl_url (for WordPress)
function maybe_ssl_url($url)
{
if (!is_ssl()) { return $url; }
return str_ireplace('http://', 'https://', $url);
}
@timstl
timstl / gist:c2dc5541094e99c72ee4
Created March 9, 2015 15:20
jquery.vadjust.js
/*
vadjust plugin.
adjust top margin on vertically centered elements.
var $vadj = $('[data-vadjust="true"]');
if ($vadj.length > 0) { $vadj.vadjust(); }
*/
;(function($) {
$.fn.vadjust = function(options)
@DrewDouglass
DrewDouglass / robot.php
Created November 2, 2015 14:54
Automate HTML Preview JPGs for Clients
<?php
//While <= number of files to create
$count = 1;
while($count <= 18) {
if($count === 1) {
$filename = 'index.html';
}
else {
$filename = $count.'.html';
@DrewDouglass
DrewDouglass / rsync.sh
Last active June 9, 2020 18:53
Rsync from remote to local with custom ssh port
# Simple with recursion and info/progress
rsync -havzP --stats remote@host:/your/path ~/Desktop/your/folder
#Custom Port
rsync -chavzP --stats -e "ssh -p 1999" remote@host:/path/to/files ~/Desktop/local/folder
@erobert17
erobert17 / bootstrap-3-vert-offset-shim.css
Last active May 2, 2022 18:36
Adds a vertical offset top and bottom to Bootstrap 3 to be used within columns. Currently no vertical offset is available as standard in Bootstrap 3.
/*
Include this after bootstrap.css. Add class of
vert-offset-top-value or vert-offset-bottom-value
to your Bootstrap 3 default rows to prevent row content
from touching the row content above or below.
*/
/* Vertical Offset Bottom */
.vert-offset-top-12{
margin-top: 12em;
@argyleink
argyleink / is.css
Last active December 9, 2022 20:15
light intro to the :is() selector syntax and value
/* before :is() */
button.focus,
button:focus {
...
}
/* after :is() */
button:is(.focus, :focus) {
...
}