Skip to content

Instantly share code, notes, and snippets.

View Akkuma's full-sized avatar

Greg W Akkuma

View GitHub Profile
@Akkuma
Akkuma / Is Capitalized ==
Last active August 29, 2015 14:21
Simple JavaScript functions to check if a string is capitalized
//Assumes that a string is made up of only letters
function isCapitalized(str) {
var char = str[0];
return char.toUpperCase() == char;
}
@Akkuma
Akkuma / Bundle.cs
Created October 28, 2010 15:50
Added the ability to force release from the constructor (optional)
using SquishIt.Framework.Css;
using SquishIt.Framework.JavaScript;
namespace SquishIt.Framework
{
public class Bundle
{
public static IJavaScriptBundle JavaScript(bool forceRelease = false)
{
return new JavaScriptBundle(forceRelease);
@Akkuma
Akkuma / jquery.browser.js
Created February 3, 2011 22:16
Updated jQuery Browser to take browsers with a version number > 9 into account and use opera's built-in .version over regex
/*
jQuery Browser Plugin
* Version 2.4
* 2010-02-03
* URL: http://jquery.thewikies.com/browser
* Description: jQuery Browser Plugin extends browser detection capabilities and can assign browser selectors to CSS classes.
* Author: Nate Cavanaugh, Minhchau Dang, Jonathan Neal, & Gregory Waxman
* Copyright: Copyright (c) 2008 Jonathan Neal under dual MIT/GPL license.
* JSLint: This javascript file passes JSLint verification.
var lookup = {}
var testObj = {'test':true};
lookup[testObj] = expensiveFunc(testObj);
@Akkuma
Akkuma / jquery.ui.selectmenu proper width
Created March 17, 2011 18:03
Fixes the improper width issue by showing and then hiding the element before it does the width calculation. It could be stored, but then if the select's size is altered then the element would be off.
/*
* jQuery UI selectmenu
*
* Copyright (c) 2009 AUTHORS.txt (http://jqueryui.com/about)
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
*
* http://docs.jquery.com/UI
* https://github.com/fnagel/jquery-ui/wiki/Selectmenu
*/
@Akkuma
Akkuma / jquery.innershiv.js
Created March 25, 2011 20:15
An integrated innershiv
// jQuery patch for HTML5 elements using innerShiv by https://github.com/andy-clusta
(function ($) {
var init = jQuery.fn.init; rootjQuery = jQuery(document);
// http://jdbartlett.github.com/innershiv | WTFPL License
var innerShiv = (function() {
var div, frag,
inaTable = /^<(tbody|tr|td|col|colgroup|thead|tfoot)/i,
remptyTag = /(<([\w:]+)[^>]*?)\/>/g,
rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
@Akkuma
Akkuma / JS.html
Created November 10, 2011 17:15 — forked from jwax/Javascript homework
<!DOCTYPE html>
<html>
<head>
<title>JavaScript Assignment 3: Jonathan Waxman</title>
</head>
<body>
<table border="1" width="100%" height="550">
<tr>
<th colspan="2" bgcolor="navy" style="color:white">
<h1>JW's Electronic Post - eCommerce</h1>
@Akkuma
Akkuma / application.coffee
Created April 20, 2012 14:19
Tower.js Passport Example
passport = require 'passport'
googOID = require('passport-google').Strategy
steamOID = require('passport-steam').Strategy
passport.use new steamOID
returnURL: 'http://localhost:3000/auth/steam/return'
, realm: 'http://localhost:3000'
, () -> console.log arguments
passport.use new googOID
@Akkuma
Akkuma / comma-first-var.js
Created July 26, 2012 16:19 — forked from isaacs/comma-first-var.js
A better coding convention for lists and object literals in JavaScript
// See comments below.
// This code sample and justification brought to you by
// Isaac Z. Schlueter, aka isaacs
// standard style
var a = "ape",
b = "bat",
c = "cat",
d = "dog",
@Akkuma
Akkuma / style.js
Created July 26, 2012 18:54
520 Style
//Comma first, used by both Isaac Z. Schlueter and TJ Holowaychuk
//modified with the opening bracket on the same line as declaration
//Variable assignment and object property value right aligned
var objectStyle = {
property1 : 'test'
, prop2 : 3
, property : 4
};