Currently only supports the /search endpoint docs.
Install NodeJS if you haven't already Download Node
- Download zip of this gist
- unzip file and
cdinto directory
| osascript -e 'tell application "System Events" to tell security preferences to get require password to wake' |
| function responseLimit(maxResponses, tallyField) { | |
| var form = FormApp.getActiveForm(); | |
| var responses = form.getResponses(); | |
| var guestCount = 0; | |
| var len = parseInt(responses.length, 10) | |
| for (var i = 0; i < len; i++) { | |
| var itemResponses = responses[i].getItemResponses(); | |
| for (var j = 0; j < itemResponses.length; j++) { |
| function responseLimit(maxResponses) { | |
| var form = FormApp.getActiveForm(); | |
| var responses = form.getResponses(); | |
| if(responses.length >= maxResponses) { | |
| form.setAcceptingResponses(false); | |
| } | |
| } | |
| function onOpen(e) { | |
| FormApp.getUi() |
Currently only supports the /search endpoint docs.
Install NodeJS if you haven't already Download Node
cd into directory| scm_ps1() { | |
| local s= | |
| if [[ -d ".svn" ]] ; then | |
| s=\(svn:$(svn info | sed -n -e '/^Revision: \([0-9]*\).*$/s//\1/p' )\) | |
| else | |
| s=$(__git_ps1 "(git:%s)") | |
| fi | |
| echo "$s" | |
| } | |
| export PS1="\[\033[00;32m\]\u\[\033[00;32m\]@\[\033[00;32m\]\h:\[\033[01;34m\]\w \[\033[31m\]\$(scm_ps1)\[\033[00m\]$\[\033[00m\] " |
| // need to load https://cdnjs.cloudflare.com/ajax/libs/UAParser.js/0.7.10/ua-parser.min.js or something similar | |
| // to be used with window.onerror (e.g. window.onerror = logError); | |
| const logError = (message, file, line, col, error) => { | |
| try { | |
| var parser = new UAParser(); | |
| var userInfo = parser.getResult(); | |
| var http = new XMLHttpRequest(); | |
| var params = JSON.stringify({ | |
| userInfo: { | |
| os: `${userInfo.os.name} ${userInfo.os.version}`, |
| input = [ | |
| [1,2,3], | |
| [4,5,6], | |
| [7,8,9], | |
| ] | |
| input2 = [ | |
| [1, 2, 3, 4], | |
| [5, 6, 7, 8], | |
| [9, 10, 11, 12], |
| 'use strict'; | |
| const primeSieve = (n) => { | |
| const p = (new Array(n)).fill(1); | |
| for (let i = 2; i <= n; ++i) { | |
| for (let j = i * i; j <= n; j += i) { | |
| p[j] = 0; | |
| } | |
| } | |
| return p.map((i, x) => i ? x : i).filter(i => i); |
| /** | |
| * jQuery Reduce | |
| * Function signature is identical to native Array.reduce - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/Reduce | |
| * @author Rob McVey | |
| */ | |
| $.fn.reduce = function(){ | |
| var args = Array.prototype.slice.call(arguments, 0); | |
| return Array.prototype.slice.call(this, 0).reduce.apply(this, args); | |
| } |
| define(['Controller', 'jsx!app/reports/views', 'jsx!views/datavis', 'jsx!views/shared', 'models/Report', 'react'], | |
| function(Controller, Views, DataVis, Shared, Report, React) { | |
| var vent = Application.Events; | |
| // these will all be added on top of the controller namespace | |
| var routes = { | |
| // base route (<controller>/) | |
| '': function(){ | |
| var reportCollection = new Report.List(); | |
| vent.on('report:filter', function(filter){ | |
| // update the where clause on the Backbone.Collection fetch |