Skip to content

Instantly share code, notes, and snippets.

Avatar
🌲

Julaine Scott JulaineScott

🌲
View GitHub Profile
@JulaineScott
JulaineScott / image.css
Created Apr 13, 2022
How to make image fit an item
View image.css
.container > div > img {
width: 100%;
height: 1005;
object-fit: cover;
}
@JulaineScott
JulaineScott / web.config
Created Jan 4, 2022
Config file for Drupal
View web.config
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<!-- Don't show directory listings for URLs which map to a directory. -->
<directoryBrowse enabled="false" />
<!--
Caching configuration was not delegated by default. Some hosters may not
delegate the caching configuration to site owners by default and that
may cause errors when users install. Uncomment this if you want to and
@JulaineScott
JulaineScott / CSS
Created Nov 30, 2021
Sticky Announcement Header
View CSS
[insert name of top navbar] {
padding: 20px;
}
.announcement-top-bar {
position: -webkit-sticky;
position: -moz-sticky;
position: -ms-sticky;
position: -o-sticky;
position: sticky;
View gist:f5faf1027a9e4125fdc65c02fe17c598
<div class="review-form-inner has-border">
<div id="respond" class="comment-respond">
<h3 id="reply-title" class="comment-reply-title">Add a review <small><a rel="nofollow" id="cancel-comment-reply-link" href="/blue-coma/#respond" style="display:none;">Cancel reply</a></small></h3><form action="https://deliverymeds.ca/wp-comments-post.php" method="post" id="commentform" class="comment-form" novalidate="" enctype="multipart/form-data" encoding="multipart/form-data"><div class="comment-form-rating"><label for="rating">Your rating&nbsp;<span class="required">*</span></label><p class="stars"> <span> <a class="star-1" href="#">1</a> <a class="star-2" href="#">2</a> <a class="star-3" href="#">3</a> <a class="star-4" href="#">4</a> <a class="star-5" href="#">5</a> </span> </p><select name="rating" id="rating" required="" style="display: none;">
<option value="">Rate…</option>
<option value="5">Perfect</option>
<option value="4">Good</option>
@JulaineScott
JulaineScott / advent-calendar.js
Created Sep 8, 2021
Advent Calendar JavaScript
View advent-calendar.js
var Utility = {
getPosition : function(el){
var oL = el.offsetLeft, oT = el.offsetTop;
var oE = el;
while(oE = oE.offsetParent){
oL = oL + oE.offsetLeft;
oT = oT + oE.offsetTop;
}
return [oL, oT];
},
View advent-calendar.css
/* ========= */
/* = Doors = */
/* ========= */
.doors {
margin: 4rem 0;
counter-reset: days;
}
.doors > li{
View drop shadows the better way
//@source https://codepen.io/joshwcomeau/pen/mdVZKwr
.drop-shadow {
filter: drop-shadow(2px 4px 8px hsla(0deg, 0%, 0%, 0.5))
}
@JulaineScott
JulaineScott / make-slugs
Created Apr 7, 2020
Change php files to slugs
View make-slugs
#1)externally redirect "/file.php" to "/file"
RewriteCond %{THE_REQUEST} /([^.]+)\.php [NC]
RewriteRule ^ /%1 [NC,L,R]
#2)Internally map "/file" back to "/file.php"
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*?)/?$ /$1.php [NC,L]
@JulaineScott
JulaineScott / helpers.css
Created Apr 4, 2020
Lots of helpful CSS classes
View helpers.css
.mt0{margin-top:0!important;}
.mt2{margin-top:2px!important;}
.mt5{margin-top:5px!important;}
.mt10{margin-top:10px!important;}
.mt15{margin-top:15px!important;}
.mt20{margin-top:20px!important;}
.mt25{margin-top:25px!important;}
.mt30{margin-top:30px!important;}
.mt35{margin-top:35px!important;}
.mt40{margin-top:40px!important;}
View Colorize SVG
style="filter: invert(.95) sepia(.95);"