Skip to content

Instantly share code, notes, and snippets.

View timwright12's full-sized avatar

Tim Wright timwright12

View GitHub Profile
# PATH updates
export NVM_DIR=~/.nvm
export PATH="/usr/local/opt/ruby/bin:$PATH"
source $(brew --prefix nvm)/nvm.sh
# Terminal Alias
NEWLINE=$'\n'
ME=$'tim'
PROMPT="${NEWLINE}%B%F{white}%1~%f%b${NEWLINE}[%m][${ME}] -> "

Keybase proof

I hereby claim:

  • I am timwright12 on github.
  • I am timwright12 (https://keybase.io/timwright12) on keybase.
  • I have a public key ASAgVkzSQwMbH3ljfBAfqLK3fbQ7E23nFVt1ZLHcuIhPjQo

To claim this, I am signing this object:

#!/usr/bin/env bash
runCmd() {
echo ""
echo ">>> $@"
echo ""
eval "$@"
local code=$?
[[ $code -ne 0 ]] && return $code
}
# Terminal Alias
PS1='\n\W\n[\h][\u] -> '
# Command alias
alias edithosts='sudo vi /private/etc/hosts'
alias editbash='atom-beta ~/.bash_profile'
alias phpserver='php -S localhost:8000'
alias pythonserver='python -m SimpleHTTPServer 8888'
alias npm-remove-packages='rm -rf node_modules/ && rm -rf package-lock.json'
alias npm-reset-packages='rm -rf node_modules/ && rm -rf package-lock.json && npm install'
/**
* Get URL params
*
* @param {String} query - The location.search query
* @returns {Object} - the params
*/
export const getUrlParams = ( query ) => {
const vars = query.split( '&' );
const queryString = {};
/**
* @file A simple Ajax call that will work down to IE10
* @author Tim Wright
* @license MIT
* @example ajaxCall({ 'url' : 'http://...', 'type' : 'GET', 'data' : 'json' }, function( data ){ /callback function here/ });
*/
( function ( global ) {
'use strict';
/** @function
* @name debounce
* @description Utility method for debouncing the resize event
* @param {function} func
* @param {number} wait
* @param {object} immediate
* @example var myEfficientFn = debounce(function() { things to do }, 250);
* @example window.addEventListener( 'resize', myEfficientFn );
*/
# Terminal Alias
PS1='\n\W\n[\h][\u] -> '
# PATH updates
PATH=$PATH:/usr/local/bin
PATH=/usr/local/bin:$PATH
export PATH=~/.composer/vendor/bin:$PATH
# Command alias
alias edithosts='sudo vi /private/etc/hosts'
@timwright12
timwright12 / visually-hidden.css
Created August 17, 2017 17:29
Visually Hidden
.visually-hidden {
border: 0;
clip-path: inset(50%);
display: inline-block;
height: 1px;
margin: -1px;
overflow: hidden;
padding: 0;
width: 1px;
white-space: nowrap;
@timwright12
timwright12 / Bookmarklet.js
Last active May 15, 2020 17:37
Bookmarklet to share links in WordPress
/*
* Bookmarklet is an external script for sharing content Via wordpress
* It was specifically designed for csskarma.com, but feel free to nab it.
*
* Bookmarklet content ( NOTE: change the URL path ):
*
* javascript:(function ()%7Bvar jsCode %3D document.createElement(%27script%27)%3BjsCode.setAttribute(%27src%27, %27https://csskarma.com/js/bookmarklet.js%27)%3Bdocument.body.appendChild(jsCode)%3B %7D())%3B
*
*/