This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var gradeLetters = ['a', 'b+', 'b', 'c+', 'c', 'd', 'f', 'af', 'wf'], | |
gradePoints = [4, 3.5, 3, 2.5, 2, 1, 0, 0, 0]; | |
function getNumCoursesToBeEntered() { | |
"use strict"; | |
var numCourses = 0, | |
input = ""; | |
do { | |
input = prompt("Enter number of subjects?"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (typeof window.localStorage == 'undefined' || typeof window.sessionStorage == 'undefined') (function () { | |
var Storage = function (type) { | |
function createCookie(name, value, days) { | |
var date, expires; | |
if (days) { | |
date = new Date(); | |
date.setTime(date.getTime()+(days*24*60*60*1000)); | |
expires = "; expires="+date.toGMTString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jk############################################################################### | |
# | |
# MIME-TYPES and the extensions that represent them | |
# | |
# This file is part of the "mime-support" package. Please send email (not a | |
# bug report) to [email protected] if you would like new types | |
# and/or extensions to be added. | |
# | |
# The reason that all types are managed by the mime-support package instead | |
# allowing individual packages to install types in much the same way as they |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A worked example based on http://docs.pylonsproject.org/projects/pyramid/en/1.3-branch/narr/urldispatch.html#using-pyramid-security-with-url-dispatch | |
# in your configuration section (typically in myapp/__init__.py) | |
config.add_route('articles.edit', 'article/{id}/edit', factory='myapp.acl.ArticleACL') | |
# in myapp/acl.py | |
class ArticleACL(object): | |
def __init__(self, request): | |
# First, we assume this ACL object is used only in routes that provide an article id; if need be, you can add some sanity checking here, or some if/else branching |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias c="clear" | |
alias ll="ls -alH" | |
# Git Alias | |
alias gb="git branch" | |
alias gs="git status" | |
alias gss="git status -s" | |
alias gc="git checkout" | |
alias gbn="git checkout -b" | |
alias gd="git diff" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Handlebars.registerHelper('equal', function(lvalue, rvalue, options) { | |
if (arguments.length < 3) | |
throw new Error("Handlebars Helper equal needs 2 parameters"); | |
if( lvalue!=rvalue ) { | |
return options.inverse(this); | |
} else { | |
return options.fn(this); | |
} | |
}); |