Skip to content

Instantly share code, notes, and snippets.

View JulaineScott's full-sized avatar
🌲

Julaine Scott JulaineScott

🌲
View GitHub Profile
@JulaineScott
JulaineScott / gradients.css
Created December 4, 2023 21:37
CSS Gradients
/*Rainbow*/
background: radial-gradient(50% 123.47% at 50% 50%,#00ff94 0,#720059 100%),linear-gradient(121.28deg,#669600 0,red 100%),linear-gradient(360deg,#0029ff 0,#8fff00 100%),radial-gradient(100% 164.72% at 100% 100%,#6100ff 0,#00ff57 100%),radial-gradient(100% 148.07% at 0 0,#fff500 0,#51d500 100%);
background-blend-mode: screen,color-dodge,overlay,difference,normal;
/*Version 2*/
background: #42275a;
background: -webkit-linear-gradient(to right, #734b6d, #42275a);
background: linear-gradient(to right, #734b6d, #42275a);
/*Version 3*/
@JulaineScott
JulaineScott / copy.js
Created March 23, 2023 15:58
Copy To Clipboard
const input = document.querySelector('input');
const btn = document.querySelector('button');
btn.addEventListener('click', () => {
navigator.clipboard.writeText(input.value);
})
@JulaineScott
JulaineScott / components.php
Created December 2, 2022 16:51
Blue Sheet boxes
/**
* Format the classes as boxes
* when showing code structure
*
* @return string
*/
public static function blueSheet(): string
{
return <<<HEREDOC
<style>
@JulaineScott
JulaineScott / load-ajax-panel.js
Created September 11, 2022 03:49
Load a url into a something
//1. We're going to use jQuery to get the href attribute of the link that was just clicked:
$(document).ready(function(){
$('#ajax-nav a').bind('click', function(){
var url = $(this).attr('href');
return false;
});
});
//Now we have a variable called url that contains the href attribute of the link that was clicked.
@JulaineScott
JulaineScott / image.css
Created April 13, 2022 03:53
How to make image fit an item
.container > div > img {
width: 100%;
height: 1005;
object-fit: cover;
}
@JulaineScott
JulaineScott / web.config
Created January 4, 2022 04:56
Config file for Drupal
<?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 November 30, 2021 05:18
Sticky Announcement Header
[insert name of top navbar] {
padding: 20px;
}
.announcement-top-bar {
position: -webkit-sticky;
position: -moz-sticky;
position: -ms-sticky;
position: -o-sticky;
position: sticky;
@JulaineScott
JulaineScott / make-slugs
Created April 7, 2020 05:14
Change php files to 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 / gist:f5faf1027a9e4125fdc65c02fe17c598
Created September 28, 2021 03:39
Form with stars as graphics
<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 September 8, 2021 06:01
Advent Calendar JavaScript
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];
},