This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
using System; | |
using System.Collections; | |
using System.Text.RegularExpressions; | |
namespace website.lib | |
{ | |
public enum BadwordSensitivity | |
{ | |
low = 1, medium = 2, high = 3 |
class GithubAPI | |
require 'net/http' | |
require 'net/https' | |
require 'uri' | |
require 'open-uri' | |
# Get the configuration values from APP_CONFIG | |
Token = APP_CONFIG['github_api_token'] | |
Base_Url = APP_CONFIG['github_api_url'] | |
User = APP_CONFIG['github_api_user'] |
#Set Primary address a.k.a Billing Address [ugh] | |
class BillingInformationController < ApplicationController | |
no_login_required | |
before_filter :must_be_at_least_an_authenticated_user | |
before_filter :cart_should_not_be_empty | |
radiant_layout 'normal' | |
helper :users, :orders |
for (int i = 0; i < dummyPkgs.Count; i++) | |
{ | |
DataRow rslt_row = rslt.NewRow(); | |
rslt_row[col_pkg_no] = dummyPkgs[i].Row["package_no"]; | |
rslt_row[col_pkg_desc] = dummyPkgs[i].Row["description"]; | |
decimal[] zone_prices = new decimal[ZONE_COUNT]; | |
for (int j = 0; j < ZONE_COUNT; j++) | |
{ | |
zone_prices[j] = 0M; | |
} |
module Webservices | |
module Responses | |
module GetOrder | |
class GetOrderResponse | |
include Webservices::Responses::ResponseErrorHandler, CulturaldistrictApp::OrderDetails | |
attr_reader :order, :line_items, :shipping_address, :contributions, :gift_cards, | |
:redeemed_gift_cards, :gift_card_fees, :parking_line_items, :restaurant_line_items, :package_line_items, | |
:flex_package_line_items, :package_parking_line_items, :package_restaurant_line_items, :fee_line_items, | |
:super_package_line_items |
$(document).ready(function() { | |
$('td.notes_container input[type="button"]').each(function(index) { | |
$(this).click(function(event) { | |
var container = $(this).parent(); | |
ajaxPostNotes(container); | |
}); | |
}); | |
}); |
module GoogleCustomSearch | |
class SearchResultItem | |
attr_reader :title, :content | |
def initialize(hash = {}) | |
@errors = [] | |
hash.each do |key, value| | |
self.instance_variable_set("@#{key}", value) |
function checkCredentials() { | |
// Set user action to Authenticate | |
document.UserForm.useraction.value = 'login'; | |
if (document.UserForm.url.value == '') { | |
alert('Please enter the authenticatin url'); | |
return false; | |
} | |
if (document.UserForm.username.value == '' || document.UserForm.password.value == '') { |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
<script type="text/javascript"> | |
jQuery(document).ready(function($){ | |
$('.datepicker').datepicker({ changeMonth: true, changeYear: true, minDate: '-1y', maxDate: '+3y'}); | |
$.validator.addMethod("time", function(value, element) { | |
return this.optional(element) || /^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$/i.test(value); | |
}, "Please enter a valid time."); | |
$("#post").validate({ | |
rules: { | |
time: "required time" |