This file contains hidden or 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
| (function() { | |
| require['vendor/jquery.dataTables']; | |
| }).call(this); |
This file contains hidden or 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
| require ['jquery', 'sfu_stats/vendor/jquery.dataTables'], ($) -> | |
| // do things here that rely on jquery.dataTables | |
| $('#courses').dataTable({.......}); |
This file contains hidden or 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
| courses = Course.all(:conditions => "root_account_id = 2 AND enrollment_term_id = 5 AND workflow_state != 'deleted'") | |
| types = ['StudentEnrollment', 'TeacherEnrollment', 'TaEnrollment', 'DesignerEnrollment', 'ObserverEnrollment', 'StudentViewEnrollment'] | |
| total_enrollments = {} | |
| types.each do |t| | |
| total_enrollments[t] = 0 | |
| end | |
| courses.each do |c| | |
| enrollments = c.enrollments.count(:distinct => true, :group => 'enrollments.type', :select => 'users.id', :conditions => 'enrollments.role_name IS NULL') | |
| puts "#{c.id} #{enrollments}" | |
| enrollments.each do |type, num| |
This file contains hidden or 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
| Enrollment.count( | |
| :select => "enrollments.course_id || ':' || enrollments.user_id", | |
| :distinct => true, | |
| :joins => :course, | |
| :group => "enrollments.type", | |
| :conditions => [" | |
| enrollments.course_id = courses.id AND | |
| enrollments.root_account_id = 2 AND | |
| courses.enrollment_term_id = 5 AND | |
| enrollments.role_name IS NULL AND |
This file contains hidden or 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 net = require('net'); | |
| var fs = require('fs'); | |
| var file = '/tmp/offlinecache'; | |
| var port = 2003; | |
| net.createServer(function(socket) { | |
| socket.name = socket.remoteAddress + ":" + socket.remotePort; | |
| console.log ("Connection: %s", socket.name); | |
| socket.on('data', function(data) { | |
| console.log(data.toString()); |
This file contains hidden or 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
| onPage(/\/courses\/\d+\/settings/, function() { | |
| // do something | |
| }); | |
| hasAnyRole('admin', function(hasRole) { | |
| if (hasRole) { | |
| // do something | |
| } else { | |
| // do something else | |
| } |
This file contains hidden or 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
| # works | |
| require 'bamboo_api' | |
| SCHEDULER.every '30s', :first_in => 0 do | |
| BambooApi.new({ | |
| end_point: settings.bamboo[:bamboo_host], | |
| username: settings.bamboo[:bamboo_username], | |
| password: settings.bamboo[:bamboo_password] |
This file contains hidden or 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/rails/canvas | |
| │ ├── current -> /var/rails/canvas/releases/20140128222236 | |
| │ ├── releases | |
| │ │ ├── 20140128214428 | |
| │ │ ├── 20140128215321 | |
| │ │ ├── 20140128220058 | |
| │ │ ├── 20140128220329 | |
| │ │ └── 20140128222236 | |
| │ └── shared | |
| │ ├── cached-copy |
This file contains hidden or 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
| == AddAttachmentRootAttachmentForeignKey: migrating ========================== | |
| rake aborted! | |
| An error has occurred, all later migrations canceled: | |
| uninitialized constant Shard::IDS_PER_SHARD |