Skip to content

Instantly share code, notes, and snippets.

Josh Buchea joshbuchea

Block or report user

Report or block joshbuchea

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional


joshbuchea / .gitignore
Last active Dec 29, 2019
Git Ignore Examples
View .gitignore
# node.js #
# Packages #
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
View cloudSettings
joshbuchea / select-1-100.html
Last active Sep 6, 2019
A select box with options 1–100
View select-1-100.html
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
joshbuchea /
Created Aug 8, 2019 — forked from matteocrippa/
a script to quick setup my dev Mac
#!/usr/bin/env bash
echo "Install XCode first"
xcode-select --install
# Setup directories
mkdir ~/Projects
mkdir ~/Projects/Repositories
mkdir ~/Projects/Material
joshbuchea / force-lowercase-urls.php
Created Oct 18, 2015
A function to redirect uppercase URLs to lowercase.
View force-lowercase-urls.php
* Changes the requested URL to lowercase.
* Only if URL does not include a filename or query variable.
function force_lowercase_urls() {
// Grab requested URL
// If URL contains a period, halt (likely contains a filename and filenames are case specific)
if ( preg_match('/[\.]/', $url) ) {
joshbuchea / get-url-params.js
Last active Mar 12, 2019
JavaScript - Get URL Query Params
View get-url-params.js
* Returns a bare object of the URL's query parameters.
* You can pass just a query string rather than a complete URL.
* The default URL is the current page.
function getUrlParams (url) {
if (typeof url == 'undefined') {
url =
joshbuchea / gist:e769eb87b6f462af8d71fcebc30c7061
Created May 19, 2016 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs
View gist:e769eb87b6f462af8d71fcebc30c7061

Share Counts

I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.

If you want to roll up all of these into a single jQuery plugin check out Sharrre

Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.


joshbuchea /
Created Jun 21, 2017 — forked from cvan/
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default


CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
View Google Maps Simple Multiple Marker Example
<title>Google Maps Multiple Markers</title>
<script src="" type="text/javascript"></script>
<div id="map" style="height: 400px; width: 500px;">
<script type="text/javascript">
You can’t perform that action at this time.