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 / spotlight.sh
Created July 10, 2016 15:54 — forked from senderista/spotlight.sh
Some ack-style Spotlight search functions
BOLD=`echo -e '\033[1m'`
BLACK=`echo -e '\033[30m'`
RED=`echo -e '\033[31m'`
GREEN=`echo -e '\033[32m'`
YELLOW=`echo -e '\033[33m'`
BLUE=`echo -e '\033[34m'`
MAGENTA=`echo -e '\033[35m'`
CYAN=`echo -e '\033[36m'`
WHITE=`echo -e '\033[37m'`
BG_BLACK=`echo -e '\033[40m'`
@JoeyBurzynski
JoeyBurzynski / README.md
Created July 11, 2016 01:27 — forked from dominikwilkowski/README.md
Ubuntu 16.04 setup with NGINX http/2 and letsencrypt

Intro

This is a basic collection of things I do when setting up a new headless ubuntu machine as a webserver. Following the steps below should give you a reasonable secure server with HTTP/2 support (including ALPN in chrome) and the fast NGINX server. I am happy to add things so leave a comment.

Basics

After creating the server (droplet on DigitalOcean) log in with

@JoeyBurzynski
JoeyBurzynski / add_remove_class_with_js.md
Created August 10, 2016 18:08 — forked from egeorjon/add_remove_class_with_js.md
Add or Remove css class with Javascript

From: StackOverflow

To change all classes for an element:

document.getElementById("MyElement").className = "MyClass";

To add an additional class to an element:

document.getElementById("MyElement").className += " MyClass";

To remove a class from an element:

@JoeyBurzynski
JoeyBurzynski / functional-utils.js
Created October 10, 2016 16:19 — forked from bendc/functional-utils.js
A set of pure ES2015 functions aimed to make functional JavaScript more idiomatic.
// array utils
// =================================================================================================
const combine = (...arrays) => [].concat(...arrays);
const compact = arr => arr.filter(Boolean);
const contains = (() => Array.prototype.includes
? (arr, value) => arr.includes(value)
: (arr, value) => arr.some(el => el === value)
@JoeyBurzynski
JoeyBurzynski / http-benchmark.md
Created November 24, 2016 13:21 — forked from denji/http-benchmark.md
HTTP(S) Benchmark Tools / Toolkit for testing/debugging HTTP(S) and restAPI (RESTful)

Tools

Located in alphabetical order (not prefer)

  • ab – slow and single threaded, written in C
  • apib – most of the features of ApacheBench (ab), also designed as a more modern replacement, written in C
  • baloo – Expressive end-to-end HTTP API testing made easy, written in Go (golang)
  • bombardier – Fast crossplatform HTTP benchmarking tool, written in Go (golang)
  • curl-loader – performance loading of various application services and traffic generation, written in C
  • gatling – High performance load testing framework based on Scala, Akka and Netty, write in Scala
@JoeyBurzynski
JoeyBurzynski / s3_to_netstorage.sh
Created November 30, 2016 13:14 — forked from hyamamoto/ s3_to_netstorage.sh
Send file Amazon S3 bucket (aws sync) to Akamai NetStorage directory (secure rsync). Comment out 2 lines for --delete behavior.
#!/usr/bin/env bash
#
# Sync Amason S3 Bucket with Akamai NetStorage
#
# Dependency:
# "aws" command : AWS CLI
# "rsync" command :yeah, the one.
# .aws/credentials : AWS Credential file (for aws command)
# .ssj/netstorage.ppk : Private Key for your NetStorage account
@JoeyBurzynski
JoeyBurzynski / local-backup
Created November 30, 2016 13:22
Quick and dirty backups using rdiff-backup
#!/bin/sh
# Quick and dirty backups using rdiff-backup
# Usage: /path/to/local-backup --source /mnt/source \
# --destination /mnt/source-mirror \
# --lock-file /var/lock/local-backup/job-name \
# --age 4W
eval set -- "$(getopt -o "adls:" --long "age:,destination:,lock-file:,mount-point:,source:" -- "$@")"
while true; do
case "$1" in
@JoeyBurzynski
JoeyBurzynski / gist:b0a9973b15e3f594e7f1c56f867f5043
Created February 1, 2017 11:35 — forked from samnang/gist:1759336
Install Bash version 4 on MacOS X
# Install Bash 4 using homebrew
brew install bash
# Or build it from source...
curl -O http://ftp.gnu.org/gnu/bash/bash-4.2.tar.gz
tar xzf bash-4.2.tar.gz
cd bash-4.2
./configure --prefix=/usr/local/bin && make && sudo make install
# Add the new shell to the list of legit shells
@JoeyBurzynski
JoeyBurzynski / what-forces-layout.md
Last active March 17, 2017 20:41 — forked from paulirish/what-forces-layout.md
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Element

Box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
  • elem.clientLeft, elem.clientTop, elem.clientWidth, elem.clientHeight
  • elem.getClientRects(), elem.getBoundingClientRect()
@JoeyBurzynski
JoeyBurzynski / destructuring.js
Created March 30, 2017 09:33 — forked from mikaelbr/destructuring.js
Several demos and usages for ES6 destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];