Skip to content

Instantly share code, notes, and snippets.

@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>