Skip to content

Instantly share code, notes, and snippets.

@davidvanvickle
davidvanvickle / find-changes.sh
Created June 26, 2017 15:20
find local repo changes from base project directory
#!/bin/bash
for d in */ ; do
echo "-- $d --"
cd $d
git status -s
cd ..
done
function goodbye(e) {
if(!e) e = window.event;
//e.cancelBubble supported by IE - this will kill the bubbling process.
e.cancelBubble = true;
e.returnValue = 'You sure you want to leave?';
//This is displayed on the dialog
//e.stopPropagation works in Firefox.
if (e.stopPropagation) {
e.stopPropagation();
@davidvanvickle
davidvanvickle / laravelhomestead.sh
Last active October 17, 2015 18:29
Laravel Homstead install notes
# get a homestead box
vagrant box add laravel/homestead
# clone homestead and go into it
git clone git@github.com:laravel/homestead.git
cd homestead
# put composer into it
curl -sS https://getcomposer.org/installer | php
@davidvanvickle
davidvanvickle / counterclockify.js
Created September 18, 2015 22:13
If an array of coordinates is clockwise, convert it to counterclockwise.
/*
Make coordinates counter-clockwise
http://stackoverflow.com/questions/1165647/how-to-determine-if-a-list-of-polygon-points-are-in-clockwise-order
(x2-x1)(y2+y1)
point[0] = (5,0) edge[0]: (6-5)(4+0) = 4
point[1] = (6,4) edge[1]: (4-6)(5+4) = -18
@davidvanvickle
davidvanvickle / tally-table-vals.htm
Created January 14, 2015 19:32
tally table vals
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="CONTENT-TYPE" CONTENT="text/html; charset=utf-8">
<TITLE></TITLE>
<META NAME="GENERATOR" CONTENT="OpenOffice 4.1.1 (Unix)">
<META NAME="CREATED" CONTENT="0;0">
<META NAME="CHANGED" CONTENT="0;0">
@davidvanvickle
davidvanvickle / linkfilter.htm
Created January 13, 2015 20:11
turn html a tags into csv data
<!DOCTYPE html>
<html>
<head>
<title>Filter</title>
<script type="text/javascript" src="https://code.jquery.com/jquery-1.11.2.min.js"></script>
</head>
<body>
<div id="proc"><p><a href="http://www.oscars.org/hollywoodcostume/" target="_blank">Academy of Motion Picture Arts and Sciences</a> <br><a href="http://annenbergphotospace.org/" target="_blank">Annenberg Space for Photography</a> <br><a href="http://www.armoryarts.org/" target="_blank">Armory Center for the Arts</a> <br><a href="http://www.caamuseum.org/" target="_blank">California African American Museum</a> <br><a href="http://californiasciencecenter.org/" target="_blank">California Science Center</a><br><a href="http://camla.org/" target="_blank">Chinese American Museum</a>&nbsp;<br><a href="http://www.cafam.org/" target="_blank">Craft Folk &amp; Art Museum</a> <br><a href="http://www.fowler.ucla.edu/" target="_blank">Fowler Museum at UCLA</a> <br><a href="http://www.getty.edu/visit/center/" target="_blank">The Getty Center</a> <br><a href="http:
@davidvanvickle
davidvanvickle / promises.js
Last active August 29, 2015 14:12
JS promises notes
// http://www.html5rocks.com/en/tutorials/es6/promises/
function get(url) {
// Return a new promise.
return new Promise(function(resolve, reject) {
// Do the usual XHR stuff
var req = new XMLHttpRequest();
req.open('GET', url);
req.onload = function() {
@davidvanvickle
davidvanvickle / html5 sample
Created December 26, 2014 19:49
html5 sample
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="style.css">
<title></title>
@davidvanvickle
davidvanvickle / listmenu.css
Created August 2, 2013 14:57
CSS for a list converted to a menu
nav ul {
list-style-type: none;
float:left;
margin: .5em 0;
padding:0;
}
nav ul li {
list-style-type: none;
@davidvanvickle
davidvanvickle / GIT on bitbucket notes.txt
Last active December 17, 2015 21:09
GIT on bitbucket notes
GIT on bitbucket notes
Set up
1. Identify yourself
# git config --global user.name "My Name"
# git config --global user.email me@email.com
2. Set up SSH keys - add .ssh/id_rsa.pub to bitbucket
https://bitbucket.org/account/user/[username]/ssh-keys/