Skip to content

Instantly share code, notes, and snippets.

@nickcernis
nickcernis / readme.md
Last active March 7, 2024 01:43
Exclude node_modules and .git from Backblaze backups on Mac

Exclude node_modules and .git from Backblaze backups on Mac

  1. Edit the file at /Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml.
  2. Add these rules inside the bzexclusions tag:
<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*"  ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
@pixelrevision
pixelrevision / retina_replacement_example.js
Created July 6, 2012 17:43
Simple js retina image replacement
$(document).ready(function(){
var dpr = 1;
if(window.devicePixelRatio !== undefined) dpr = window.devicePixelRatio;
if(dpr >= 2){
// convert image links to @2x images
$("img").each(function(){
var newSrc = $(this).attr("src").replace(".png", "@2x.png");
newSrc = $(this).attr("src").replace(".jpg", "@2x.jpg");
newSrc = $(this).attr("src").replace(".jpeg", "@2x.jpeg");
$(this).attr("src", newSrc);