Skip to content

Instantly share code, notes, and snippets.

View JoeyBurzynski's full-sized avatar
💭
Hacking away on @EdgeSEO tools.

Joey Burzynski JoeyBurzynski

💭
Hacking away on @EdgeSEO tools.
View GitHub Profile
@JoeyBurzynski
JoeyBurzynski / cors.js
Created June 8, 2017 14:24 — forked from eriwen/cors.js
Simple cross-domain Javascript function
/**
* Make a X-Domain request to url and callback.
*
* @param url {String}
* @param method {String} HTTP verb ('GET', 'POST', 'DELETE', etc.)
* @param data {String} request body
* @param callback {Function} to callback on completion
* @param errback {Function} to callback on error
*/
function xdr(url, method, data, callback, errback) {
@JoeyBurzynski
JoeyBurzynski / .js
Created October 30, 2017 15:00 — forked from anonymous/.js
/**
* Gets 'data-*' property.
* See https://bugs.webkit.org/show_bug.cgi?id=161454
*/
function getDatasetProperty(dataset, propName) {
return typeof Reflect !== 'undefined' ? Reflect.get(dataset, propName) : dataset[ propName ]
}
@JoeyBurzynski
JoeyBurzynski / gist:eb9c8d2c8a599d03f31ac9ef11c32cc4
Created January 17, 2018 12:38 — forked from jonathanmoore/gist:2640302
Get the share counts from various APIs

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.

Twitter

@JoeyBurzynski
JoeyBurzynski / generate-ssh-key.sh
Created March 23, 2018 11:55 — forked from grenade/01-generate-ed25519-ssh-key.sh
Correct file permissions for ssh keys and config.
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/id_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/github_rsa
ssh-keygen -t rsa -b 4096 -N '' -C "[email protected]" -f ~/.ssh/mozilla_rsa
@JoeyBurzynski
JoeyBurzynski / npm-config.md
Created January 22, 2019 12:19 — forked from alimd/npm-config.md
Optimize NPM for faster installing packages

AliMd npm config

Optimize NPM for faster installing packages

Strong recommended

npm config set registry http://registry.npmjs.org/
npm config set loglevel info
npm config set fetch-retries 3
npm config set fetch-retry-mintimeout 15000
npm config set fetch-retry-maxtimeout 90000
@JoeyBurzynski
JoeyBurzynski / letsencrypt_2018.md
Created February 8, 2019 10:08 — forked from cecilemuller/letsencrypt_2020.md
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

# 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
# Generate $prerender_ua bool value based on user agent
# indexation bots will get this as 1,
# prerender user agent will always get 0 (avoid loops)
map $http_user_agent $prerender_ua {
default 0;
@JoeyBurzynski
JoeyBurzynski / github_gpg_key.md
Created January 12, 2020 02:32 — forked from ankurk91/github_gpg_key.md
Github : Signing commits using GPG (Ubuntu/Mac)

Github : Signing commits using GPG (Ubuntu/Mac) 🔐

  • Do you have an Github account ? If not create one.
  • Install required tools
  • Latest Git Client
  • gpg tools
# Ubuntu
sudo apt-get install gpa seahorse
# MacOS with https://brew.sh/
@JoeyBurzynski
JoeyBurzynski / mime-types.php
Created April 16, 2021 14:51 — forked from rosskmurphy/mime-types.php
Array of file extensions, mime types and friendly application or name
$mimeTypes = array(
'x3d' => array(
'name' => '3D Crossword Plugin',
'type' => 'application/vnd.hzn-3d-crossword'
),
'3gp' => array(
'name' => '3GP',
'type' => 'video/3gpp'
),
'3g2' => array(

Enable macOS Server Performance Mode

Performance mode changes the system parameters of your Mac. These changes take better advantage of your hardware for demanding server applications.

A Mac with macOS Server that needs to run high-performance services can turn on performance mode to dedicate additional system resources for server applications. Note, however, that performance mode can be enabled even without macOS Server being installed to achieve similar benifits for other high-performance services.

sudo nvram boot-args="serverperfmode=1 $(nvram boot-args 2>/dev/null | cut -f 2-)"
sudo reboot

Reference: https://support.apple.com/en-us/HT202528.