Skip to content

Instantly share code, notes, and snippets.

View geoff-parsons's full-sized avatar

Geoff Parsons geoff-parsons

View GitHub Profile
@geoff-parsons
geoff-parsons / live-update-chartjs.html
Created June 1, 2013 05:36
Example of live updating Chart.js charts.
<!DOCTYPE html>
<html>
<head>
<title>Chart.js Redraw Example</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>
<script type="text/javascript" charset="utf-8" src="chart.min.js"></script>
<script type="text/javascript" charset="utf-8">
window.chartOptions = {
segmentShowStroke: false,
@implementation MyAppDelegate
- (void) setUpDataMappingForObjectManager: (RKObjectManager*) objectManager
{
// Workouts
RKManagedObjectMapping* workoutMapping = [RKManagedObjectMapping mappingForClass: [Workout class]];
workoutMapping.primaryKeyAttribute = @"workoutID";
[workoutMapping mapKeyPath: @"id" toAttribute: @"workoutID"];
class ActiveRecord::Base
def self.required_columns
self.columns.reject { |column| column.null }
end
def self.required_column_names
self.required_columns.map { |column| column.name }
end
end