Skip to content

Instantly share code, notes, and snippets.

@agray
agray / bb_repo_setup.sh
Created September 17, 2015 12:42
Setup a newly created BitBucket repository locally with content and a master branch ready to go
#!/usr/bin/env bash
mkdir $1
cd $1
git init
git remote add origin https://$2@bitbucket.org/$2/$1.git
echo "Andrew Gray" >> contributors.txt
git add contributors.txt
git commit -m 'Initial commit with contributors'
git push -u origin master
@agray
agray / printDirective.js
Created February 27, 2015 03:42
A working angularJS print directive
(function (angular) {
"use strict";
function printDirective() {
var printSection = document.getElementById("printSection");
function printElement(elem) {
// clones the element you want to print
var domClone = elem.cloneNode(true);
if (!printSection) {
printSection = document.createElement("div");
@agray
agray / imagemetrouiaccordion
Created July 31, 2013 00:26
image in metroui accordion
<li>
<a href="#">Product Suites</a>
<div>
<div class="preScrollable Homepage div-ss-background-img">
<h2>Standard Edition Suite 4.0</h2>
All the Standard Edition products offered as a bundle<br/><br/>
<button type="button" class="bg-color-maroon" onclick="window.open('https://sites.fastspring.com/fullcirclesolutions/instant/standardsuite40')">
<font color="white">Purchase</font>
</button><b>Enterprise Suite coming soon!</b>
<br/><br/>