Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mmanela's full-sized avatar
💭
🍕

Matthew Manela mmanela

💭
🍕
View GitHub Profile
@mmanela
mmanela / fastfix.ps1
Created March 20, 2016 06:06
A workflow for quickly committing changes and submitting a PR to VSTS
function fastFix($branchName, $title) {
if((-not $branchName) -or (-not $title)) {
throw "You must specify branchName and title"
return
}
Write-Host "Checking out $branchName"
git checkout -b $branchName
@mmanela
mmanela / dabblet.css
Created May 11, 2013 16:51
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height:
@mmanela
mmanela / gist:3207867
Created July 30, 2012 15:36
Linking between anchors in an IFrame (Chrome and Firefox 11+)
$(function() {
var iframeOffset = $("#ID_OF_MY_IFRAME", window.parent.document).offset();
$("a").each(function () {
var link = $(this);
var href = link.attr("href");
if (href && href[0] == "#") {
var name = href.substring(1);
$(this).click(function () {
var nameElement = $("[name='" + name + "']");
var idElement = $("#" + name);
@mmanela
mmanela / prompt.ps1
Created July 30, 2012 15:27
Combined Mercurial and Git PowerShell Prompt
if (test-path function:\prompt) {
$oldPrompt = ls function: | ? {$_.Name -eq "prompt"}
remove-item -force function:\prompt
}
function prompt {
function getGitStatus {
$branch = git branch 2>&1
if($branch.Exception -eq $null) {
$status = "git"
$branch | foreach {
@mmanela
mmanela / HTMLCanvasExample.js
Created July 19, 2012 20:44
Simple JavaScript stubbing function
function renderBlueSquareAndTranslate(height,width, context) {
context.fillStyle = "#0000FF";
context.translate(50,0);
context.fillRect(0,0,height,width);
}
test("will render blue square and translate right 50px", function() {
var context = stub().of("fillRect")
.of("translate");