Skip to content

Instantly share code, notes, and snippets.

@jb510
jb510 / readme.md
Last active April 18, 2025 17:05 — forked from nickcernis/readme.md
Exclude vcs (git, svn, hg) and node_modules from Backblaze backups on Mac

Backblaze's bztransmit process loads a file called bzfileids.dat into RAM. This file is a list of all files Backblaze has previously uploaded, including a unique identifier for each file. On most systems, this files is under 100MB in size (paraphrased from Backblaze support rep Zack).

Mine had grown to 6GB. This means that anytime bztransmit runs, it will load this 6GB file into RAM while it is backing up. In doing so it was purging massive ammounts of memory causing behavior like Chrome (usign 10GB of memory on it's own) to hang/beachball for 30 seconds and then refresh all it's windows.

There is no way to alter this behavior once it's begun, aside from starting over with some files excluded. The index needs to be rebuilt from scratch without the excessibe file count, that also means you can't restart and "inherit" a previous backup.

In my case the biggest culprits were .git and node_modules, so I excluded those, started a new backup (transfered licnese) and spent a week hunting for fast internet I could

@jb510
jb510 / 9seeds-gutenberg-style-guide.html
Created December 10, 2018 04:22
9seeds-gutenberg-style-guide.html
<!-- wp:paragraph {"customTextColor":"#6c7781","customFontSize":17} -->
<p style="color:#6c7781;font-size:17px" class="has-text-color"><em>It’s a whole new way to use WordPress. Try it right here!</em></p>
<!-- /wp:paragraph -->
<!-- wp:image {"id":97629,"align":"full"} -->
<figure class="wp-block-image alignfull"><img src="https://wordpress.org/gutenberg/files/2018/07/Screenshot-4-1.png" alt="" class="wp-image-97629"/></figure>
<!-- /wp:image -->
<!-- wp:paragraph {"align":"left"} -->
<p style="text-align:left">We call the new editor Gutenberg. The entire editing experience has been rebuilt for media rich pages and posts. Experience the flexibility that blocks will bring, whether you are building your first site, or write code for a living.</p>
<!-- wp:paragraph {"customTextColor":"#6c7781","customFontSize":17} -->
<p style="color:#6c7781;font-size:17px" class="has-text-color"><em>It’s a whole new way to use WordPress. Try it right here!</em></p>
<!-- /wp:paragraph -->
<!-- wp:image {"id":97629,"align":"full"} -->
<figure class="wp-block-image alignfull"><img src="https://wordpress.org/gutenberg/files/2018/07/Screenshot-4-1.png" alt="" class="wp-image-97629"/></figure>
<!-- /wp:image -->
<!-- wp:paragraph {"align":"left"} -->
<p style="text-align:left">We call the new editor Gutenberg. The entire editing experience has been rebuilt for media rich pages and posts. Experience the flexibility that blocks will bring, whether you are building your first site, or write code for a living.</p>
@jb510
jb510 / hide-metaboxes-by-user-role.php
Created June 1, 2018 12:05
Hide metaboxes by user role
<?php
//* Hide Extra Metaboxes from certian user roles
add_action( 'init', ‘s9_remove_layouts_templates_init', 99 );
function s9_remove_layouts_templates_init() {
if ( ! is_admin() ) {
return;
}
$allowed_roles = array( 'administrator', 'super-editor', 'editor', 'author' );
function my_capitalize_string($content) {
$content = str_replace('some string', 'SOME STRING',$content);
return $content;
}
add_filter('the_content','my_capitalize_string');
add_filter('the_excerpt','my_capitalize_string');
@jb510
jb510 / hellobar-wp-plugin.php
Last active June 30, 2017 16:21
Hello Bar (Offical) plugin for WordPress done properly
<?php
/*
Plugin Name: Hello Bar (Official - modified by 9seeds to only show when admin bar isn't and to WP code standards)
Plugin URI: http://www.hellobar.com
Description: Inserts your custom Hello Bar on mauitime.com. Because of the WordPress User Bar, you might need to log out and visit your WordPress site again to see your Hello Bar. Please note that this plugin is only valid for mauitime.com. If you want to edit your Hello Bar click "Visit plugin site" below.
Version: 1.0
Author: Hello Bar
Author URI: http://www.hellobar.com
License: GPL v2
@jb510
jb510 / Keybase proof
Created May 18, 2017 06:31
Keybase proof
### Keybase proof
I hereby claim:
* I am jb510 on github.
* I am jb510 (https://keybase.io/jb510) on keybase.
* I have a public key whose fingerprint is 5FB0 273D B8DF 60A9 84C8 EA18 F4A2 D989 A666 30EB
To claim this, I am signing this object:
@jb510
jb510 / styleguide.html
Last active May 10, 2017 13:53
Post Content HTML Style Guide for WordPress
Lorem <strong>something strong</strong> dolor <em>something emphasized</em>, <del>something struck through</del> adipiscing elit. <a href="http://wordpress.org">an actual link</a>, ipsum sed <span style="text-decoration: underline;">something underlined</span> gravida, orci magna rhoncus neque, id pulvinar odio lorem non turpis. Nullam sit amet enim. Suspendisse id velit vitae ligula volutpat condimentum. Aliquam erat volutpat.
<h1>Header level one</h1>
Sed quis velit. Nulla facilisi. Nulla libero. Vivamus pharetra posuere sapien. Nam consectetuer. Sed aliquam, nunc eget euismod ullamcorper, lectus nunc ullamcorper orci, fermentum bibendum enim nibh eget ipsum. Donec porttitor ligula eu dolor. Maecenas vitae nulla consequat libero cursus venenatis. Nam magna enim, accumsan eu, blandit sed, blandit a, eros.
<h2>Header level two</h2>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Non quaeritur autem quid naturae tuae consentaneum sit, sed quid disciplinae. Et ille ridens: Video, inquit, quid agas; Duo
@jb510
jb510 / .gitignore
Created April 21, 2017 19:45
9seeds Sample .gitignore for WP Engine (and others)
*~
.DS_Store
.htaccess
.svn
.cvs
*.bak
*.swp
Thumbs.db
# wp core (as of 3.4.1)
@jb510
jb510 / gist:08142a8372681cc962960648dad89a63
Created April 20, 2017 04:11
content-security-policy report-uri
Content-Security-Policy: upgrade-insecure-requests; report-uri https://{{site_name}}.report-uri.io/r/default/csp/enforce;