Skip to content

Instantly share code, notes, and snippets.

View superchris's full-sized avatar

Chris Nelson superchris

View GitHub Profile
@superchris
superchris / campng_lab0.html
Last active December 23, 2015 00:49
CampNG Lab 0 Start
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Camp NG Example 0" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script>
<meta charset=utf-8 />
@superchris
superchris / campng_lab1.html
Last active December 23, 2015 00:49
CampNG Lab 1 Start
<!DOCTYPE html>
<html ng-app>
<head>
<meta name="description" content="Camp NG Example 2" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.12/angular.min.js"></script>
<meta charset=utf-8 />
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Camp NG Example 0" />
<script src="http://code.jquery.com/jquery.min.js"></script>
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap.css" rel="stylesheet" type="text/css" />
<link href="http://getbootstrap.com/2.3.2/assets/css/bootstrap-responsive.css" rel="stylesheet" type="text/css" />
<script src="http://getbootstrap.com/2.3.2/assets/js/bootstrap.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.1.5/angular.min.js"></script>
<meta charset=utf-8 />
@superchris
superchris / karma_conf.js
Last active December 21, 2015 19:38
slides
module.exports = function(config) {
config.set({
basePath : '../',
frameworks : ["jasmine"],
files : [
@superchris
superchris / inflight.js
Created April 20, 2013 19:58
my lil hack of ember_data inflight state to make it compatible with ember-validations and ember-easyForm
becameInvalid: function(manager, errors) {
var record = get(manager, 'record');
if (get(record, 'errors')) {
for (prop in errors) {
set(record, "errors." + prop, errors[prop]);
}
} else {
set(record, 'errors', Ember.Object.create(errors));
}
@superchris
superchris / checkout_cookbook.sh
Created July 28, 2012 17:33
command to checkout the cookbook app
#!/bin/bash
git clone git://github.com/gaslight/bfec_chicago.git cookbook
cd cookbook
bundle install --path vendor
@superchris
superchris / game.coffee
Created June 15, 2012 19:37
bowling kata
describe "bowling", ->
beforeEach ->
@game = new Game
describe "no spare or strike", ->
beforeEach ->
@game.roll(3)
@game.roll(4)
@game.roll(7)
it "should calculate the score", ->
expect(@game.score()).toEqual 14
@superchris
superchris / embedGist.js
Created June 6, 2012 14:02
no conflict embedGist
jQuery(".gist").each(function() { writeCapture.html(this, '<script src="'+jQuery(this).text()+'"></script>'); });
@superchris
superchris / table_row_view2.coffee
Created June 6, 2012 01:00
composite views blog pot code
class Example.Views.TableRowView extends Backbone.View
tagName: "tr"
attributes: ->
id: "row_#{@model.id}"
constructor: (options) ->
super
@parentView = options.parentView
@superchris
superchris / adcenter.rb
Created April 9, 2012 20:06
Adcenter savon example
module Microsoft
class Adcenter
MAX_RETRIES = 10
REPORT_WSDL_URL = "https://adcenterapi.microsoft.com/Api/Advertiser/v8/Reporting/ReportingService.svc?wsdl"
CUSTOMER_MANAGEMENT_WSDL_URL = "https://sharedservices.adcenterapi.microsoft.com/Api/CustomerManagement/v8/CustomerManagementService.svc?wsdl"
def credentials
@credentials ||= YAML::load(ERB.new(File.open(Rails.root.join("config", "adcenter.yml")).read).result)[Rails.env]