Skip to content

Instantly share code, notes, and snippets.

@mattsims
mattsims / current-year-element.js
Created January 3, 2024 16:16
Set the text content of specific elements to the current year
<script>
const currentDate = new Date();
document.querySelectorAll('[data-text-content="current-year"]')
.forEach((element) => {
element.textContent = currentDate.getFullYear();
});
</script>
@mattsims
mattsims / webflow-helpers.js
Created June 16, 2022 17:32
Various snippets useful for Webflow development
<style type="text/css">
.no-scroll {
overflow: hidden;
height: 100%;
}
</style>
<script type="text/javascript">
var Webflow = Webflow || [];
@mattsims
mattsims / apple-link-reset.css
Created June 13, 2017 14:43
How to stop Apple from making links blue
@mattsims
mattsims / arpdata.json
Last active May 5, 2017 15:21
Test results data from Juno ARP
{"results":{"result":[{"start":0,"end":84,"trackclients":{"trackclient":[]}},{"start":87,"end":441,"trackclients":{"trackclient":[{"title_id":1379821,"product_id":2,"track_id":5,"formats":{"format":[{"id":1,"type":"mp3","bit_rate":"192"},{"id":2,"type":"mp3","bit_rate":"320"},{"id":3,"type":"wav","bit_rate":""}]},"format_prices":{"format_price":[{"format_id":1,"currency_code":"GBP","amount":0.83},{"format_id":2,"currency_code":"GBP","amount":1.16},{"format_id":3,"currency_code":"GBP","amount":1.66}]},"cat_no":"HR 015","bundle_title":"About You","bundle_artists":{"artist":[]},"bundle_mirror_artists":{"artist":["Tonya Renee"]},"label":"Home Canada","track_title":"About You","track_mix_title":"Karizma Boucha remix","track_mix_artist":"","release_date":"1228867200","track_length":421,"preview_start":150,"preview_length":120,"featured":"0","classic":"0","bpm":126,"class":"single","track_genre":"Deep House"}]}},{"start":444,"end":819,"trackclients":{"trackclient":[]}},{"start":822,"end":1209,"trackclients":{"trackc
@mattsims
mattsims / .scss-lint.yml
Last active May 11, 2016 15:23
Deuce Creative's sass-lint config file
# Default application configuration that all configurations inherit from.
scss_files: "**/*.scss"
plugin_directories: ['.scss-linters']
# List of gem names to load custom linters from (make sure they are already
# installed)
plugin_gems: []
# Default severity of all linters.
@mattsims
mattsims / wpengineprep.sh
Created April 4, 2016 17:54
Bash script to prepare a site for WP Engine
#!/bin/bash -e
clear
echo "================================================================="
echo "WP Engine Preparation Script"
echo "================================================================="
# accept user input for the databse name
echo "WP Engine install name: "
@mattsims
mattsims / wpupdateplugins.sh
Created April 4, 2016 17:53
Bash script to update and commit WordPress plugins using WP-CLI
#!/bin/bash -e
git stash
plugins=`wp plugin list --fields=name,title --format=csv`
printf %s "$plugins" | while IFS= read -r plugin
do
name=`echo "$plugin" | cut -d$',' -f1`
@mattsims
mattsims / gist:df4648e116a028420b98
Last active August 29, 2015 14:22
Coda regex's for upgrading SusyOne to Susy 2.x
Search: at-breakpoint
Replace: susy-breakpoint
Search (regex): span-columns\((\d{1,2})( omega)?\)
Replace: span(\1\2)
Search (regex): span-columns\((\d{1,2})( omega)?,
Replace: span(\1\2 of
Search (regex): pre\((\d{1,2})( omega)?,