Skip to content

Instantly share code, notes, and snippets.

View bdombro's full-sized avatar

Brian Dombrowski bdombro

View GitHub Profile
@bdombro
bdombro / CommonBinaryExtensions.txt
Created May 13, 2018 21:40
Common Binary Extensions
*.3ds
*.3g2
*.3gp
*.7z
*.a
*.aac
*.adp
*.ai
*.aif
*.aiff
@bdombro
bdombro / .gitlfstracks
Last active March 27, 2024 16:43
Git LFS Default Tracks - Common binary file extensions
"To include this, run `cat .gitlfstrack | xargs git lfs track`"
"*.3ds"
"*.3g2"
"*.3gp"
"*.7z"
"*.a"
"*.aac"
"*.adp"
"*.ai"
"*.aif"
@bdombro
bdombro / wp-cli-installer.sh
Created May 10, 2018 19:33
Install wp-cli
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
chmod +x wp-cli.phar
sudo mv wp-cli.phar /usr/local/bin/wp
@bdombro
bdombro / youtube-play-when-visible.js
Created March 16, 2018 17:15
youtube-play-when-visible.js
/*
This code will autostart a youtube when visible and stop when not. You could alternatively purchase plugin ARVE pro.
Caveits:
- Only currently works with one video right now
- Depends on jQuery
Usage: Add this anywhere
<div class="youtube-smartstart-iframe" data-youtube-id="vfuLDmGbqTI"></div>
@bdombro
bdombro / bulkupdate.vpf
Created December 29, 2017 17:45
Salesforce Bulk Update Using Remote Object JS Library
<apex:page docType="html-5.0" title="Sync Ship Date">
<apex:slds /> <!-- for lightning style -->
<style>
.create-invoice h3 {
padding:20px 0; text-align:center;
}
.create-invoice .hover-style {
cursor:pointer;
color: #2771CB;
@bdombro
bdombro / wp-disable-top-admin-bar-from-subscribers.php
Created December 13, 2017 19:05
Wordpress: Disable Top Admin Bar from Subscribers
/**
* Disable admin bar on the frontend of your website
* for subscribers.
* Add this to <them>/functions.php
*/
function functionsphp_disable_admin_bar() {
if( ! current_user_can('edit_posts') )
add_filter('show_admin_bar', '__return_false');
}
add_action( 'after_setup_theme', 'functionsphp_disable_admin_bar' );
@bdombro
bdombro / fetch-graphql.jsx
Last active September 27, 2018 02:34
fetch-graphql.jsx - Run a simple GraphQL Query using isomorphic-fetch
/**
* Run a GraphQL Query using isomorphic-fetch
*/
const HTTP_BAD_REQUEST = 400
const endpoint = "https://api.graph.cool/simple/v1/cj9g48vlm79hy0120m4tvigm9"
let fetchGraphQLCache = [];
export default (query, callback) => {
@bdombro
bdombro / google-map-multi-point.html
Created June 20, 2017 19:45
Google map multi-point
<div id="blurb-google-map-multi-point">
<div id="multi-map" style="width:{{ width }}; height:{{ height }}"></div>
<script src="//maps.googleapis.com/maps/api/js?key=KEYHERE"></script>
<script>
window.addEventListener("load", function () {
var geocoder;
var latitude = 38.930125;
@bdombro
bdombro / mozjpeg-recursive.sh
Created April 28, 2017 13:26
mozjpeg-recursive.sh
#!/bin/bash
if (( $# != 1 )); then
echo "Illegal number of parameters"
exit 1
fi
find $1 -type f -regex '.*\(jpg\|jpeg\|JPG\)$' -exec mozjpeg -copy none -outfile {} {} \;
@bdombro
bdombro / nginx.conf
Last active February 10, 2017 12:48 — forked from thoop/nginx.conf
Official prerender.io nginx.conf for nginx
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats
# Change example.com (server_name) to your website url
# Change /path/to/your/root to the correct value
server {
listen 80;
server_name example.com;
root /path/to/your/root;
index index.html;