Skip to content

Instantly share code, notes, and snippets.

Chance Smith chancesmith

Block or report user

Report or block chancesmith

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
@chancesmith
chancesmith / index.html
Created Aug 20, 2018
simple css spinner
View index.html
<div class="spinner"></div>
@chancesmith
chancesmith / readme.md
Last active Feb 6, 2018
Wordpress Setup shell script
View readme.md

Setup Instructions

  • add wp-setup.sh to your home directory
  • in terminal $ chmod +x wp-setup.sh so we can execute this without admin permissions needed
  • add an alias in your terminal profile and source the profile...(see command in next step)
  • $ echo '\n\n alias wpsetup="~/wp-setup.sh"' >> ~/.zshrc && . ~/.zshrc

Usage

Now, when you are ready run $ wpsetup in the folder you want to setup Wordpress locally in.

View lazy-load-images.js
// #1 using the spread operator get all our images with the class 'lazyload'
const imgElements = [...document.querySelectorAll('.adg-lazy-image')]
// IE browser support :(
var isIE;
(function() {
var ua = window.navigator.userAgent,
msie = ua.indexOf('MSIE '),
trident = ua.indexOf('Trident/')
@chancesmith
chancesmith / .hyper.js
Last active Oct 17, 2017
hyper terminal settings
View .hyper.js
// Future versions of Hyper may add additional config options,,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// default font size in pixels for all tabs
fontSize: 18,
// font family with optional fallbacks
@chancesmith
chancesmith / animate.js
Created Sep 12, 2017
Animate elements in and out on scroll
View animate.js
// onScroll animation
$(function() {
var $window = $(window),
isTouch = Modernizr.touch;
if (isTouch) { $('.add-animation').addClass('animated'); }
$window.on('scroll', revealAnimation);
@chancesmith
chancesmith / main.js
Last active Sep 5, 2017
ToysRUs price drop percentage
View main.js
// test page: https://www.toysrus.com/search?q=dyl01sep17%20creator
// just copy this code in the console on a page
// that has all items with a price drop
var items = document.getElementsByClassName('product-item')
//var prices = items.getElementsByClassName('product-price')
var collection = []
for (var i=0; i<items.length; i++) {
// get link of item
var productLink = items[i].href
var productName = items[i].getElementsByClassName('product-item__product-title')[0].textContent
@chancesmith
chancesmith / .zshrc
Last active Feb 13, 2018
ZSH profile
View .zshrc
plugins=(git sublime cloudapp node npm osx extract z)
# User configuration
# Remap alt-left and alt-right to forward/backward word skips.
# via @waltz, https://gist.github.com/waltz/8658549
bindkey "^[^[[D" backward-word
bindkey "^[^[[C" forward-word
# export MANPATH="/usr/local/man:$MANPATH"
@chancesmith
chancesmith / readme.md
Last active Mar 21, 2018
Setup Mac Computer Guide for Website Developement
View readme.md
@chancesmith
chancesmith / .profile
Created May 10, 2017
personal .profile preferences
View .profile
alias work='cd ~/work-in-progress/'
alias home='cd ~'
## get rid of command not found ##
alias cd..='cd ..'
## a quick way to get out of current directory ##
alias ..='cd ..'
alias editprofile= 'subl ~/.bash_profile && subl ~/.profile'
@chancesmith
chancesmith / st3_sync.md
Last active Apr 7, 2017 — forked from mindmergedesign/st3_sync
Sync Sublime Text 3 Packages and Settings with Dropbox
View st3_sync.md

Sync ST3 Packages & Settings with Dropbox or Encore

Inital setup from main computer

Create the sync directory in Dropbox

  • $ mkdir ~/Dropbox/sublime-text-3

Move your ST3 "Packages" and "Installed Packages" to Dropbox

  • $ cd ~/Library/Application\ Support/Sublime\ Text\ 3
  • $ mv Packages/ ~/Dropbox/sublime-text-3
  • $ mv Installed\ Packages/ ~/Dropbox/sublime-text-3
You can’t perform that action at this time.