Skip to content

Instantly share code, notes, and snippets.

Drew Douglass DrewDouglass

View GitHub Profile
@DrewDouglass
DrewDouglass / getParams.js
Created Dec 5, 2018
jQuery get URL Param
View getParams.js
var getUrlParameter = function getUrlParameter(sParam) {
var sPageURL = window.location.search.substring(1),
sURLVariables = sPageURL.split('&'),
sParameterName,
i;
for (i = 0; i < sURLVariables.length; i++) {
sParameterName = sURLVariables[i].split('=');
if (sParameterName[0] === sParam) {
@DrewDouglass
DrewDouglass / findFonts.sh
Last active Nov 10, 2018
Find fonts used in PDF file on Mac OS
View findFonts.sh
strings ~/Desktop/filename.pdf | grep FontName
@DrewDouglass
DrewDouglass / workaround-js.html
Last active Jan 30, 2019
Load scripts in webskins that do not load them
View workaround-js.html
<!-- Assumes jQuery is loaded which is almost always the case -->
<img src="/your/image.jpg" alt="Logo" onload="$.getScript('https://yoursite.com/main.js');">
@DrewDouglass
DrewDouglass / scroll.js
Created Nov 8, 2018
Scroll to top - jQuery
View scroll.js
$("a[href='#top']").click(function() {
$("html, body").animate({ scrollTop: 0 }, "slow"); //Can replace with milliseconds
return false;
});
@DrewDouglass
DrewDouglass / .htaccess
Created Sep 28, 2018
a2 redirect from ahosted subdomain
View .htaccess
RewriteCond %{HTTP_HOST} !https://domainnamehere.org$ [NC]
RewriteRule ^(.*)$ https:// domainnamehere.org/$1 [R=301,L]
@DrewDouglass
DrewDouglass / target-ie-11.css
Created Sep 12, 2018
Target IE10 and 11 with media query
View target-ie-11.css
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
// IE10+ CSS here
}
@DrewDouglass
DrewDouglass / responsive-videos.css
Created Sep 12, 2018
WordPress Responsive Videos
View responsive-videos.css
.vid {
position: relative;
padding-bottom: 56.25%; /* 16:9 */
padding-top: 25px;
height: 0;
}
.vid iframe,
.vid embed {
position: absolute;
top: 0;
@DrewDouglass
DrewDouglass / gist:edae8ed762f7a4e65dbe3ebf257a9b81
Created Jun 8, 2018 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:edae8ed762f7a4e65dbe3ebf257a9b81

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@DrewDouglass
DrewDouglass / alternate.js
Created Nov 8, 2017
FullCalendar alternate calendar colors.
View alternate.js
//Globla variable outside of all functions
var altColor = 1;
//Global function
function isEven(n) {
return n % 2 == 0;
}
//This goes inside the full calendar call
eventRender: function(event, element) {
if(isEven(altColor)) {
@DrewDouglass
DrewDouglass / this-is-silly.js
Created Mar 14, 2017
FullCalendar.js put date number at bottom right of cell.
View this-is-silly.js
//Fix for FullCalendar not having
//the most basic option of positioning
//the date number.
$(".fc-content-skeleton").each(function(index, el){
var $this = $(this);
var calHead = $this.find("thead").html();
$this.find("table").append("<tfoot>"+calHead+"</tfoot>");
});
You can’t perform that action at this time.