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
/** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * | |
* AddonUtilities.gs | |
* | |
* A collection of general Google-Apps-Script utilities that are useful for | |
* development of Add-ons. | |
* | |
* From: gist.github.com/mogsdad/39db2995989110537868 | |
* | |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
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
// Takes and array of arrays matrix and return an array of elements. | |
function flatten(arrayOfArrays){ | |
return [].concat.apply([], arrayOfArrays); | |
} |
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
function scheduledCollection(){ | |
var schedule = []; | |
// dates/times in mm/dd/yyyy hh:mm - timezone matches settings in File > Project properties | |
schedule.push({start:"08/29/2012 15:00", end:"08/29/2012 16:00"}); | |
schedule.push({start:"08/29/2012 20:00", end:"08/29/2012 22:00"}); | |
checkCollect(schedule); | |
} | |
function checkCollect(schedule){ | |
var now = new Date(); |
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
// ==UserScript== | |
// @name Card style View in Google result | |
// @namespace https://twitter.com/yume_yu | |
// @homepage https://gist.github.com/yume-yu/0381656dab58175ec64527f04397479c | |
// @supportURL https://twitter.com/yume_yu | |
// @version 0.3.4.1 | |
// @description This scripts add cardView to your GoogleSearchResult. | |
// @author @yume_yu | |
// @match https://www.google.com/search* | |
// @grant none |
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
// Get all users | |
var url = "http://localhost:8080/api/v1/users"; | |
var xhr = new XMLHttpRequest() | |
xhr.open('GET', url, true) | |
xhr.onload = function () { | |
var users = JSON.parse(xhr.responseText); | |
if (xhr.readyState == 4 && xhr.status == "200") { | |
console.table(users); | |
} else { | |
console.error(users); |
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
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
that detects and handles AJAXed content. | |
Usage example: | |
waitForKeyElements ( | |
"div.comments" | |
, commentCallbackFunction | |
); |
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
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts, | |
that detects and handles AJAXed content. | |
Usage example: | |
waitForKeyElements ( | |
"div.comments" | |
, commentCallbackFunction | |
); |
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
" _ _ " | |
" _ /|| . . ||\ _ " | |
" ( } \||D ' ' ' C||/ { % " | |
" | /\__,=_[_] ' . . ' [_]_=,__/\ |" | |
" |_\_ |----| |----| _/_|" | |
" | |/ | | | | \| |" | |
" | /_ | | | | _\ |" | |
It is all fun and games until someone gets hacked! |
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 python3 | |
triviafile = 'trivia.csv' | |
apiurl = 'https://opentdb.com/' | |
sleep_between_requests = 0.1 | |
questionsPerRequest = 50 | |
import requests, os, hashlib, json, sys, csv, urllib, time | |
unquote = urllib.parse.unquote |
NewerOlder