Skip to content

Instantly share code, notes, and snippets.

@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 / 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 / json-object-array-foreach-loop.php
Last active December 11, 2022 15:54
Foreach loop through JSON object array
<?php
$json = '[
{
"categories": "10,11",
"title": "Promos",
"columns": "col-md-3"
},
{
"categories": "10,12",
@chancesmith
chancesmith / notification-bar-set-cookie.html
Created November 7, 2016 20:11
Bootstrap alert top notification bar + cookie set after closed
@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
};
@chancesmith
chancesmith / scroll-to-top.html
Created October 24, 2016 16:10
Scroll-to-top icon (slide in/out)
<style>
// scroll to top
#back-to-top{
position: fixed;
bottom: -66px;
right: 20px;
color: white;
z-index: 3;
width: 40px;
height: 40px;
@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>