Skip to content

Instantly share code, notes, and snippets.

View akornmeier's full-sized avatar

Tony Kornmeier akornmeier

View GitHub Profile
app = angular.module 'BlogExample', []
# Simple controller that loads all blog posts
app.controller 'BlogCtrl', ['$scope', 'Blog', ($scope, Blog) ->
# Get all the blog posts
Blog.all().then (posts) ->
$scope.posts = posts
# Extend the $scope with our own properties, all in one big block
# I like this because it looks like declaring a class.
@akornmeier
akornmeier / beforeunload
Created February 17, 2015 17:21
Crossbrowser prevent page from reloading
window.addEventListener("beforeunload", function (e) {
var confirmationMessage = "\o/";
(e || window.event).returnValue = confirmationMessage; // Gecko and Trident
return confirmationMessage; // Gecko and WebKit
});
'use strict';
overlay.exports = function ariaTokenAttr(helperId, attr) {
// aria token attributes supported
// aria-controls(element, id)
// aria-describedBy(element, id)
// aria-flowTo(element, id)
// aria-labelledBy(element, id)
// aria-owns(element, id)
@akornmeier
akornmeier / oops
Created March 3, 2015 21:35
Erase a commit from GIT on remote
git reset --hard HEAD~2 {NUMBER OF COMMITS YOU FUCKED UP}
then `git commit` what should be comitted
and `git push --force`
// only use on your own fork, it will kill history of other people's commits if the HEAD is set back too far.
<section class="module color showimg preselect" data-common-name="color"
data-selector-type="box">
<h2 class="fab-body">
<em>color</em> <span>pink stripe</span>
</h2>
<div class="swap">
<span>
<a>
<label>
<span>color</span>
@akornmeier
akornmeier / WQraWq.markdown
Last active September 21, 2015 14:52
WQraWq
@akornmeier
akornmeier / edit .bash_profile
Created May 28, 2012 15:59
Open .bash_profile in text edit
open -e .bash_profile
@akornmeier
akornmeier / example.html
Created October 9, 2015 21:07
GxT link role
<a title="Citi.com" onclick="this.href=getFinalURL(this.href);lnk(this.href);return false;" href="/US/Welcome.c?JFP_TOKEN=RN26FVP8">
<img alt="Citi.com logo" src="https://productest3.web.citi.com/JRS/images/citi-logo.png">
</a>
@akornmeier
akornmeier / gist:4567958
Created January 18, 2013 19:58
Migrator Framework Extension Method for extending the Command Timeout past the default 30 seconds. (Used for adding Indexes)
public static class MigrationExtensions
{
public static int ExecuteNonQuery(this ITransformationProvider itp, string sql, int timeout)
{
itp.Logger.Trace(sql);
itp.Logger.ApplyingDBChange(sql);
IDbCommand ic = itp.GetCommand();
ic.CommandText = sql;
ic.CommandTimeout = timeout;
try { return ic.ExecuteNonQuery(); }