Skip to content

Instantly share code, notes, and snippets.

View thexmanxyz's full-sized avatar
🐌
work work work

Andreas Kar thexmanxyz

🐌
work work work
View GitHub Profile
@thexmanxyz
thexmanxyz / _openinghours.scss
Last active March 29, 2020 13:42
Startbootstrap - Business Casual - dynamic opening hours
.opening-hours-section {
&.cta {
padding: 3rem 0 2.5rem 0;
background-color: fade-out($primary, 0.1);
.cta-inner {
position: relative;
padding: 2rem;
margin: 0.5rem;
background-color: fade-out($white, 0.15);
&:before {
@thexmanxyz
thexmanxyz / Simple-Copyright-Generator.php
Last active March 20, 2020 13:01
Simple PHP Copyright Generator
@thexmanxyz
thexmanxyz / Lazy-Loading-Images-Spinner.html
Last active March 16, 2020 14:33
Lazy load images and remove BS4 spinner dynamically
<div class="lazy-load-ctn">
<div class="spinner-grow loading-img" role="status">
<span class="sr-only">Loading...</span>
</div>
<img data-src="img/yourimage.png" class="img-fluid lazy">
</div>
@thexmanxyz
thexmanxyz / Scrollspy-Dynamic-Offset.js
Last active March 6, 2020 09:26
Bootstrap 4 - Scrollspy dynamic navbar offset
var initScrollSpy = function() {
var navContainer = '#mainNav'; // your navigation container
// initial bind of scrollspy
var bindScrollSpy = function() {
$('body').scrollspy({
target: navContainer,
offset: getOffset() // determine your offset
});
}
@thexmanxyz
thexmanxyz / SD-Ethernet-Buffered-Read-Write.c
Last active March 6, 2020 09:26
Arduino - SD.h / Ethernet.h - Buffered file read / write
int bufferSize = 64; // buffer size you want to use
while(file.available()) // file you previously pointed at
{
char buffer[bufferSize];
memset(buffer, '\n', bufferSize); // don't forget to fill the buffer with \n to prevent errors on last buffer read
file.read(&buffer, bufferSize); // read from file
client->write(buffer, bufferSize); // write to client
}