Skip to content

Instantly share code, notes, and snippets.

🤘
Doing things.

Kyle Brumm kjbrum

🤘
Doing things.
Block or report user

Report or block kjbrum

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
View tailwind-colors.js
module.exports = {
...
theme: {
colors: {
transparent: 'transparent',
black: '#333333',
white: '#ffffff',
blue: {
@kjbrum
kjbrum / dev-environment-setup.md
Last active Jul 9, 2019
Quick steps for getting your local dev environment up and running.
View dev-environment-setup.md

Dev Environment Setup

Be sure to follow these steps in order, or you might run into unexpected issues.

Xcode

# When asked about the command line tools, hit install.
xcode-select --install
@kjbrum
kjbrum / browserdetect.js
Last active Jan 31, 2019
Detect the current browser and version using the user agent.
View browserdetect.js
/**
* browserdetect.js
* Detect the current browser and version using the user agent.
* Credit: https://stackoverflow.com/a/13480430/6272119
*/
var BrowserDetect = {
dataBrowser: [
{ string: navigator.userAgent, subString: "Edge", identity: "MS Edge" },
{ string: navigator.userAgent, subString: "MSIE", identity: "Explorer" },
{ string: navigator.userAgent, subString: "Trident", identity: "Explorer" },
@kjbrum
kjbrum / reinstall-mysql.md
Last active Jul 6, 2018
Completely remove MySQL and reinstall.
View reinstall-mysql.md
@kjbrum
kjbrum / r_strip_tags_array.php
Last active May 8, 2018
Strip tags from an array
View r_strip_tags_array.php
<?php
/**
* Strip tags from an array.
*
* @param array $arr The array to remove tags from
* @return array The new array without tags
*/
function r_strip_tags_array( $arr ) {
if( ! is_array( $arr ) ) return $arr;
@kjbrum
kjbrum / php-switcher.sh
Last active Mar 21, 2018
Easily switch between PHP versions with Homebrew and Laravel Valet.
View php-switcher.sh
#!/usr/bin/env bash
# PHP Switcher
# Easily switch between PHP versions with Homebrew and Laravel Valet.
# Copyright (C) Kyle Brumm <http://kylebrumm.com>
#
# Credit/Resources:
# https://gist.github.com/bgarrant/b9a2f7fb8ff06c9a45086359ded7a95e
# https://raw.githubusercontent.com/conradkleinespel/sphp-osx/master/sphp
@kjbrum
kjbrum / gitrinse.md
Last active Jan 24, 2018 — forked from nicktoumpelis/repo-rinse.sh
Clean and reset a Git repo and/or it's submodules.
View gitrinse.md

Clean and reset a Git repo and/or it's submodules

Remove untracked/ignored files/directories and uncommitted changes.

Repo and submodules

$ git clean -xfd
$ git submodule foreach --recursive git clean -xfd
$ git reset --hard
@kjbrum
kjbrum / letsencrypt-serverpilot.md
Last active Jan 23, 2018 — forked from knynkwl/letsencrypt.md
Installing Let's Encrypt with Certbot on DigitalOcean w/ServerPilot
View letsencrypt-serverpilot.md

Let's Encrypt on DigitalOcean w/ServerPilot

  • APP_NAME - ServerPilot App Name (serverpilot/apps/example)
  • DOMAIN_NAME - Domain name (example.com)

1. SSH as root into the server

$ ssh root@SERVER_IP_ADDRESS
@kjbrum
kjbrum / wordpress-ajax.md
Last active May 29, 2018
Quick example of how to use AJAX with WordPress.
View wordpress-ajax.md

WordPress Ajax

Template

<form class="form">
    <label for="password">Password</label>
    <input name="password" type="password">
    <?php wp_nonce_field( 'password_check_form' ); ?>
@kjbrum
kjbrum / dewidow.php
Last active Oct 27, 2017
Make sure a string never has a widow.
View dewidow.php
<?php
/**
* Make sure a string never has a widow.
*
* @param string $text The string to dewidow
* @param int $min_words Minimum number of words to dewidow
* @return string The dewidowed string
*/
function dewidow( $text = '', $min_words = 3 ) {
$return = trim( $text );
You can’t perform that action at this time.