Skip to content

Instantly share code, notes, and snippets.

@chancesmith
chancesmith / .hyper.js
Last active October 17, 2017 17:32
hyper terminal settings
// 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 September 12, 2017 12:27
Animate elements in and out on scroll
// 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 September 5, 2017 14:25
ToysRUs price drop percentage
// 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 / .profile
Created May 10, 2017 03:49
personal .profile preferences
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 April 7, 2017 12:04 — forked from mindmergedesign/st3_sync
Sync Sublime Text 3 Packages and Settings with Dropbox

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
@chancesmith
chancesmith / indent_code.js
Created April 3, 2017 18:45
auto indent on Sublime Text
[
{ "keys": ["ctrl+shift+r"], "command": "reindent" , "args": { "single_line": false } }
]
@chancesmith
chancesmith / bootstrap-3-page-template.html
Last active March 20, 2017 23:29
Single Bootstrap 3 & 4(alpha) pages with CDN assets
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap 3 Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- styles -->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
<style> body {padding-top: 40px; } </style>
@chancesmith
chancesmith / extensions.json
Last active March 3, 2017 14:11
vscode setup
[
{
"metadata": {
"id": "d34ed0fc-97a2-40d5-bd7d-f97b3658c92f",
"publisherId": "4434843a-4ebf-4f44-84f5-4176380c492d",
"publisherDisplayName": "johnpapa"
},
"name": "Angular1",
"publisher": "johnpapa",
"version": "0.1.16"
@chancesmith
chancesmith / equalHeight.js
Created February 15, 2017 19:44
Bootstrap Equal Height columns
function eqHeight(className) {
var elements = $(className);
// loop through each element with said className
elements.each(function(i){
var targetHeight = 0;
$el = $(this);
// loop through immediate children
$el.children().each(function(i){
$child = $(this);
console.log($child);
@chancesmith
chancesmith / wp-config.php
Last active October 26, 2016 19:41
local wordpress developement URL
// source: http://mardell.me/blog/how-to-use-a-single-wordpress-config-for-local-and-remote-environments/
/////
if ($_SERVER['SERVER_NAME'] === "blog.dev") {
// test site
define( 'WP_SITEURL', 'http://blog.dev' );
define( 'WP_HOME', 'http://blog.dev' );
} else {
// live site
};