Skip to content

Instantly share code, notes, and snippets.

@damky
damky / scroll-element-into-view.js
Created December 16, 2024 19:51
a js solution for scrolling to section with id instead of using <a href="#section" /> anchor tags
// html:
// <a href="javascript:;" data-scroll-to="section">Click Me!</a>
// <div id="section" class="scroll-to-section"></div>
// <h2>Section</h2>
// css:
// width: 100%;
// height: 0;
// margin-top: -6rem;
// padding-top: 6rem;
// position: relative;
div {
/* position / size repeat attachment origin clip url background-color */
background: 50% 50% / cover no-repeat scroll padding-box border-box url(https://media2.giphy.com/media/v1.Y2lkPTc5MGI3NjExdHp5aWdxaGIwYm93ZHIwajMyNGMyNnhsZGNsZ3l6ZTM5ZXJ1eXd4bCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/GRPy8MKag9U1U88hzY/giphy.webp) blue;
}
@damky
damky / getAllPostPermalinks.php
Created September 17, 2024 19:55
get all wp post permalinks
@damky
damky / cookiesToObject.js
Created June 22, 2022 16:52
cookies to object
const parsedCookies = document.cookie.split('; ').reduce((prev, current) => {
const [name, ...value] = current.split('=');
prev[name] = value.join('=');
return prev;
}, {});
export default parsedCookies
{"ease":".25,.1,.25,1","linear":"0,0,1,1","ease-in":".42,0,1,1","ease-out":"0,0,.58,1","ease-in-out":".42,0,.58,1","golden":".67,0,.4,1","windup2bounce":"1,-0.61,.36,1.14"}
@damky
damky / Ready.js
Created January 19, 2022 18:39
Ready function that waits for one or more target elements to be on the page before executing callback function
function Ready(target, cb) {
let observer;
const config = {
attributes: true,
childList: true,
subtree: true,
characterData: true
};
if (!observer) {
observer = new MutationObserver(check);
@damky
damky / README.md
Last active November 14, 2021 19:34 — forked from jdennes/README.md
Convert a directory of .m4a files to .mp3 files
  • You need ffmpeg installed. If you have Homebrew installed on a Mac, you can do this by running:

    brew install ffmpeg
    
  • Put process.sh in directory containing .m4a files.

  • Ensure it's executable:

@damky
damky / test.html
Last active November 9, 2017 23:53
test
<pre><code>[[[divstyle:TProw|[[[divstyle:TPcol-lg-5 TPcol-xs-6|[[[PIC:Lgo-ICN-nav-c309.png||[[[page:##]]]||TPphoneIcnBan]]][[[PAGE-SP:FORM-477|Request an Appointment|TPstyle4 color:#a8dff9;|||Request an Appointment]]]]]] [[[divstyle:TPcol-lg-5 TPcol-xs-6|[[[PIC:ICN-phone-white-c309.png||||TPphoneIcnBan]]][[[divstyle:TPstyle4|[[[Client:OfficePhone]]] ]]] ]]] [[[divstyle:TPcol-lg-2 TPcol-xs-12 TPsocialSticky|[[[PIC:ICN-sm-Facebook-blue-c309.png||https://www.facebook.com/Nicholas-G-Dose-DMD-Family-Dentistry-in-Lake-Oswego-256916411076800/||TPsmBtnsBan]]] [[[PIC:ICN-sm-yelp3-blue-c309.png||https://www.yelp.com/biz/nicholas-dose-dmd-family-dentistry-in-lake-oswego-lake-oswego||TPsmBtnsBan]]] [[[PIC:ICN-sm-google-blue-c309.png||https://plus.google.com/+LakeOswegoDentalCare||TPsmBtnsBan]]] ]]] ]]]</code></pre>