{"commit":"574cd0c57972a5ede488b94ecc77969a0eaec907","old_file":"lib\/ui\/components\/common\/base.js","new_file":"lib\/ui\/components\/common\/base.js","old_contents":"import React from 'react';\nimport styled from 'styled-components';\n\nexport const DivComponent = (props) => (\n \n { props.children }\n <\/mimic-div>\n);\n\nexport const SpanComponent = (props) => (\n \n { props.children }\n <\/mimic-span>\n);\n\nexport const Div = styled(DivComponent)`\n display: block;\n`;\n\nexport const Span = styled(SpanComponent)`\n display: inline-block;\n`;\n\n\n","new_contents":"import React from 'react';\nimport styled from 'styled-components';\n\nexport const DivComponent = (props) => (\n \n { props.children }\n <\/mimic-div>\n);\n\nexport const SpanComponent = (props) => (\n \n { props.children }\n <\/mimic-span>\n);\n\nexport const Div = styled(DivComponent)`\n display: block;\n box-sizing: content-box;\n\n * {\n box-sizing: content-box;\n }\n`;\n\nexport const Span = styled(SpanComponent)`\n display: inline-block;\n box-sizing: content-box;\n\n * {\n box-sizing: content-box;\n }\n`;\n\n\n","subject":"Fix box sizing overrides from normalizer","message":"Fix box sizing overrides from normalizer\n","lang":"JavaScript","license":"mit","repos":"500tech\/bdsm,500tech\/mimic,500tech\/bdsm,500tech\/mimic"} {"commit":"ea514b9beda70d8fccd3f22a8645f512d3891009","old_file":"shared\/js\/storage.js","new_file":"shared\/js\/storage.js","old_contents":"var storage = chrome.storage.sync;\nconst DEFAULT_STORAGE = chrome.storage.sync;\nconst TEST_STORAGE = chrome.storage.local;\n\nvar count = 0;\nchrome.storage.onChanged.addListener(function(changes, areaName) {\n\tif (areaName == \"sync\")\n\t\tconsole.log(++count, changes);\n});\n\n\/**\n * Reset the storage to the default storage for normal use.\n *\/\nfunction resetStorageToDefault() {\n\tstorage = DEFAULT_STORAGE;\n}\n\n\/**\n * Get the version of the storage.\n * @param {Function} callback Function taking in a version\n *\/\nfunction getStorageVersion(callback) {\n\tstorage.get('version', function(items) {\n\t\tif (!items || !items.version) {\n\t\t\treturn callback(1);\n\t\t} else {\n\t\t\treturn callback(items.version);\n\t\t}\n\t});\n}\n\n\/**\n * Set the storage to a version.\n * @param {int} version Some version\n * @param {Function} callback\n *\/\nfunction setStorageVersion(version, callback) {\n\tstorage.set({ 'version': version }, callback);\n}\n\nfunction storageVersionExists(callback) {\n\tstorage.get('version', function(items) {\n\t\treturn callback(!items || !items.version);\n\t});\n}\n\nfunction versionsAreEqual(a, b) {\n\tif (!a || !b) {\n\t\treturn false;\n\t}\n\t\n\treturn a.major == b.major\n\t\t&& a.minor == b.minor\n\t\t&& a.patch == b.patch;\n}","new_contents":"var storage = chrome.storage.sync;\nconst DEFAULT_STORAGE = chrome.storage.sync;\nconst TEST_STORAGE = chrome.storage.local;\n\nvar count = 0;\nchrome.storage.onChanged.addListener(function(changes, areaName) {\n\tif (areaName == \"sync\")\n\t\tconsole.log(++count, changes);\n});\n\n\/**\n * Reset the storage to the default storage for normal use.\n *\/\nfunction resetStorageToDefault() {\n\tstorage = DEFAULT_STORAGE;\n}\n\n\/**\n * Get the version of the storage.\n * @param {Function} callback Function taking in a version\n *\/\nfunction getStorageVersion(callback) {\n\tstorage.get('version', function(items) {\n\t\tif (!items || !items.version) {\n\t\t\treturn callback({\n\t\t\t\tmajor: 1,\n\t\t\t\tminor: 0,\n\t\t\t\tpatch: 0\n\t\t\t});\n\t\t} else {\n\t\t\treturn callback(items.version);\n\t\t}\n\t});\n}\n\n\/**\n * Set the storage to a version.\n * @param {int} version Some version\n * @param {Function} callback\n *\/\nfunction setStorageVersion(version, callback) {\n\tstorage.set({ 'version': version }, callback);\n}\n\nfunction storageVersionExists(callback) {\n\tstorage.get('version', function(items) {\n\t\treturn callback(!items || !items.version);\n\t});\n}\n\nfunction versionsAreEqual(a, b) {\n\tif (!a || !b) {\n\t\treturn false;\n\t}\n\t\n\treturn a.major == b.major\n\t\t&& a.minor == b.minor\n\t\t&& a.patch == b.patch;\n}","subject":"Return object, not an integer, from getStorageVersion when no version is currently stored.","message":"Return object, not an integer, from getStorageVersion when no version is currently stored.\n","lang":"JavaScript","license":"mit","repos":"AntarcticApps\/Tiles,AntarcticApps\/Tiles"} {"commit":"7da8dc376231719836fa38ef5af04577c21fa053","old_file":"observer-pattern\/examples\/observer-pattern.js","new_file":"observer-pattern\/examples\/observer-pattern.js","old_contents":"var publisher = {\n subscribers: {\n any: [] \/\/ event type: subscribers\n },\n subscribe: function (fn, type) {\n type = type || 'any';\n if (typeof this.subscribers[type] === \"undefined\") {\n this.subscribers[type] = [];\n }\n this.subscribers[type].push(fn);\n },\n unsubscribe: function (fn, type) {\n this.visitSubscribers('unsubscribe', fn, type);\n },\n publish: function (publication, type) {\n this.visitSubscribers('publish', publication, type);\n },\n\n visitSubscribers: function (action, arg, type) {\n var pubtype = type || 'any',\n subscribers = this.subscribers[pubtype],\n i,\n max = subscribers.length;\n\n for (i = 0; i < max; i += 1) {\n if (action === 'publish') {\n subscribers[i](arg);\n } else {\n if (subscribers[i] === arg) {\n subscribers.splice(i, 1);\n }\n }\n }\n }\n };\n\n function makePublisher(o) {\n var i;\n for (i in publisher) {\n if (publisher.hasOwnProperty(i) && typeof publisher[i] === \"function\") {\n o[i] = publisher[i];\n }\n }\n o.subscribers = {\n any: []\n };\n }\n\n var paper = {\n daily: function() {\n this.publish('big news today');\n },\n monthly: function() {\n this.publish('interesting analysis', 'montly');\n }\n };\n\n makePublisher(paper);\n\n var joe = {\n drinkCoffee: function(paper) {\n console.log('Just read ' + paper);\n },\n sundayPreNap: function(montly) {\n console.log('About to fall asleep reading this ' + monthly);\n }\n };\n","new_contents":"function Click() {\n this.handlers = []; \/\/ Observer\n\n this.subscribe = function(fn) {\n this.handlers.push(fn);\n };\n\n this.unsubscribe = function(fn) {\n this.handlers = this.handlers.filter(function(item) {\n if(item !== fn) {\n return item;\n }\n });\n };\n\n this.fire = function(obj, thisObj) {\n var scope = thisObj || window;\n this.handlers.forEach(function(item) {\n item.call(scope, obj);\n });\n };\n}\n\n\/\/ log helper\n\nvar log = (function() {\n 'use strict';\n\n var log = '';\n return {\n add: function(msg) {\n log += msg + '\\n';\n },\n show: function() {\n console.log(log);\n log = '';\n }\n };\n}());\n\n\n(function run() {\n var clickHandler = function(item) {\n log.add('fired: ' + item);\n };\n\n var click = new Click();\n\n click.subscribe(clickHandler);\n click.fire('event #1');\n click.unsubscribe(clickHandler);\n click.fire('event #2');\n click.subscribe(clickHandler);\n click.fire('event #3');\n \n log.show();\n}());\n","subject":"Change Observer Pattern example with new one","message":"Change Observer Pattern example with new one\n","lang":"JavaScript","license":"mit","repos":"KleoPetroff\/javascript-design-patterns"} {"commit":"1961cd1213bd0920514c554cddaf598aa1152ce5","old_file":"tasks\/browserSync.js","new_file":"tasks\/browserSync.js","old_contents":"var task = function(gulp, config) {\n 'use strict';\n gulp.task('browserSync', function() {\n \n var path = require('path');\n var fs = require('fs');\n var browserSync = require('browser-sync').create();\n var html5Regex = new RegExp('\\\/'+config.name+'\\\/(.*)$');\n\n browserSync.init({\n server: {\n \/\/ Serve both project root and dist to enable sourcemaps\n baseDir: [process.cwd(), config.dist.root],\n middleware: function (req, res, next) {\n var location;\n \/\/ Enable CORS\n res.setHeader('Access-Control-Allow-Origin', '*');\n \/\/ Rewrite html5 urls\n var matches = html5Regex.exec(req.url);\n \/\/console.log('req', req.url);\n var file = path.join(config.dist.root, req.url);\n \/\/console.log('file', file);\n if (req.method === 'GET' && matches && !fs.existsSync(file)) {\n \/\/console.log('no file -> hashbang!');\n location = '\/'+config.name+'\/#!'+matches[1];\n res.writeHead(302, {'Location': location});\n res.end();\n } else {\n \/\/console.log('serve file');\n next();\n }\n },\n directory: config.dirListings || false\n },\n \/\/ Watch for updates in dist\n files: [config.dist.root+'\/**\/*'],\n \/\/ Disable input mirroring between connected browsers\n ghostMode: false,\n open: false\n });\n\n });\n};\n\nmodule.exports = task;\n","new_contents":"var task = function(gulp, config) {\n 'use strict';\n gulp.task('browserSync', function() {\n\n var path = require('path');\n var fs = require('fs');\n var browserSync = require('browser-sync').create();\n var html5Regex = new RegExp('\\\/'+config.name+'\\\/(.*)$');\n\n browserSync.init({\n server: {\n \/\/ Serve both project root and dist to enable sourcemaps\n baseDir: [process.cwd(), config.dist.root],\n middleware: function (req, res, next) {\n var location;\n \/\/ Enable CORS\n res.setHeader('Access-Control-Allow-Origin', '*');\n \/\/ Rewrite html5 urls\n var matches = html5Regex.exec(req.url);\n \/\/console.log('req', req.url);\n var file = path.join(config.dist.root, req.url.split('?')[0]);\n \/\/console.log('file', file);\n if (req.method === 'GET' && matches && !fs.existsSync(file)) {\n console.log('no file -> hashbang!', file);\n location = '\/'+config.name+'\/#!'+matches[1];\n res.writeHead(302, {'Location': location});\n res.end();\n } else {\n console.log('serve file', file);\n next();\n }\n },\n directory: config.dirListings || false\n },\n \/\/ Watch for updates in dist\n files: [config.dist.root+'\/**\/*'],\n \/\/ Disable input mirroring between connected browsers\n ghostMode: false,\n open: false\n });\n\n });\n};\n\nmodule.exports = task;\n","subject":"Fix bug in serving partial css files","message":"Fix bug in serving partial css files\n","lang":"JavaScript","license":"mit","repos":"npolar\/npdc-gulp"} {"commit":"1cd36378a8d8992860be6d6a41bb7e55b23d3165","old_file":"contactmps\/static\/javascript\/embed-secretballot.js","new_file":"contactmps\/static\/javascript\/embed-secretballot.js","old_contents":"if (document.location.hostname == \"localhost\") {\n var baseurl = \"\";\n} else {\n var baseurl = \"https:\/\/representme.co.za\";\n}\ndocument.write('
<\/div>');\ndocument.write('