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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>lesson-learner-analytics</title> | |
<script type="text/javascript"> | |
var Keen=Keen||{configure:function(e){this._cf=e},addEvent:function(e,t,n,i){this._eq=this._eq||[],this._eq.push([e,t,n,i])},setGlobalProperties:function(e){this._gp=e},onChartsReady:function(e){this._ocrq=this._ocrq||[],this._ocrq.push(e)}};(function(){var e=document.createElement("script");e.type="text/javascript",e.async=!0,e.src=("https:"==document.location.protocol?"https://":"http://")+"dc8na2hxrj29i.cloudfront.net/code/keen-2.1.0-min.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)})(); | |
</script> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
<style> |

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
{ | |
"color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme", | |
"dictionary": "Packages/Language - English/en_GB.dic", | |
"spell_check": true, | |
"draw_minimap_border": true, | |
"font_size": 12.0, | |
"highlight_line": true, |
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
source_files: | |
- http://localhost:8080/diffux.js # For convenience, for use with webpack server. Is ignored on CircleCI. | |
- diffux-new.js | |
snapshots_folder: ./diffux_snapshots |
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
#!/usr/bin/env node | |
const commandLineArgs = require('command-line-args'); | |
const { existsSync, writeFileSync } = require('fs'); | |
const { execSync } = require('child_process'); | |
const jmerge = require('junit-merge/lib'); | |
const path = require('path'); | |
const syncRequest = require('sync-request'); | |
// Copyright Jan Paul Posma, 2017. Licensed under MIT license. |
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
#!/usr/bin/env ruby | |
require 'pronto' | |
module Pronto | |
class RegexWarnings < Runner | |
# Matchers arguments: path, text, addition, first_changed_line | |
def matchers | |
{ | |
->(path, text, addition, _) { path.match(/\.js$/) && text.include?('http:') && addition } => |
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
def identity_of_model(model, global_excluded=['id', 'created_at', 'updated_at', 'deleted_at']) | |
excluded_columns = model.class.reflect_on_all_associations.map(&:foreign_key) + global_excluded | |
identity = model.attributes.except(*excluded_columns) | |
model.class.reflect_on_all_associations(:has_many).sort_by(&:name).each do |ref| | |
identity[ref.name.to_s] = model.send(ref.name).map(&method(:identity_of_model)).sort_by(&:to_json) | |
end | |
model.class.reflect_on_all_associations(:has_and_belongs_to_many).sort_by(&:name).each do |ref| | |
identity["#{ref.name}_counts"] = model.send(ref.name).count | |
end | |
identity |
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
module Interactors | |
module ApplyDiffsToMapDocumentData | |
def self.call(map_id:, diffs:) | |
return if diffs.empty? | |
sql = <<-SQL | |
UPDATE maps SET document_data = | |
#{diffs.count.times.map { 'jsonb_set(' }.join('')} | |
document_data | |
#{diffs.each_with_index.map { |diff, i| ", '{#{diff[:path].join(',')}}', :value_#{i})" }.join('')} |
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
module ModelsHelper | |
# Expects that only the passed in models have counts that change. For this we | |
# look at all ActiveRecord models, and store their counts. | |
# | |
# Example: `expect_only_counts_changing(Trip: -1) { Trip.first.delete }` | |
# | |
# This gives stronger guarantees against future models being affected | |
# unexpectedly by other parts of the code base. | |
def expect_only_counts_changing(expected_changes) | |
previous_counts = ModelsHelper.counts |
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
const uniq = require('lodash/uniq'); | |
function permutations(n, colors, arr) { | |
if (!n) return [arr]; | |
if (!arr) arr = []; | |
let ret = []; | |
for (let i = 0; i < colors; i++) ret = ret.concat(permutations(n - 1, colors, arr.concat([i]))); | |
return ret; | |
} |
OlderNewer