Skip to content

Instantly share code, notes, and snippets.

View kjbrum's full-sized avatar
🤘

Kyle Brumm kjbrum

🤘
View GitHub Profile
@kjbrum
kjbrum / gitrinse.md
Last active September 29, 2022 13:16 — forked from nicktoumpelis/repo-rinse.sh
Clean and reset a Git repo and/or it's submodules.

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 / php-switcher.sh
Last active March 21, 2018 19:14
Easily switch between PHP versions with Homebrew and Laravel Valet.
#!/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 / r_strip_tags_array.php
Last active May 8, 2018 18:48
Strip tags from an array
<?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 / reinstall-mysql.md
Last active December 5, 2020 19:34
Completely remove MySQL and reinstall.
@kjbrum
kjbrum / browserdetect.js
Last active November 17, 2020 23:10
Detect the current browser and version using the user agent.
/**
* 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 / dev-environment-setup.md
Last active July 9, 2019 21:56
Quick steps for getting your local dev environment up and running.

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 / Base.js
Last active April 19, 2023 22:51
React primitive components using styled-system (with styled-components).
import React, { forwardRef } from 'react'
import styled from 'styled-components'
import css, { get } from '@styled-system/css'
import {
system,
compose,
space,
color,
typography,
layout,
@kjbrum
kjbrum / Sass Helpers
Last active October 23, 2021 11:38
Helper files for writing Sass.
# Sass Helpers
- Variables
- Functions
- Mixins
// Credit: https://gist.github.com/yangshun/9892961
const video = {
parse: function(url) {
// - Supported YouTube URL formats:
// - http://www.youtube.com/watch?v=My2FRPA3Gf8
// - http://youtu.be/My2FRPA3Gf8
// - https://youtube.googleapis.com/v/My2FRPA3Gf8
// - Supported Vimeo URL formats:
// - http://vimeo.com/25451551
// - http://player.vimeo.com/video/25451551
@kjbrum
kjbrum / README.md
Last active April 27, 2020 16:30
Scripts for removing popups