Skip to content

Instantly share code, notes, and snippets.

@huschdie
huschdie / tic_toc.js
Created July 24, 2016 07:19
stopper for the code
// add this line on the top
var d0 = new Date();
// add this line on the bottom
var d1 = new Date()
var how_long = (d1.getTime()-d0.getTime())/1000
@huschdie
huschdie / to_md5.gs
Created July 24, 2016 06:43
Code text to md5
function to_md5(text_to_md5) {
var toMD5 = text_to_md5 //md5sheet.getRange('b9').getValue()
var signature = Utilities.computeDigest(Utilities.DigestAlgorithm.MD5, toMD5, Utilities.Charset.US_ASCII);
var signatureStr = '';
for (i = 0; i < signature.length; i++) {
var byte = signature[i];
if (byte < 0)
@huschdie
huschdie / runQ.gs
Last active July 24, 2016 06:44
Running BigQuery-queries (sql, projectId, output_sheet)
function runQ(sql,projectId,output_sheet) {
var request = {
query: sql
};
var queryResults = BigQuery.Jobs.query(request, projectId);
var jobId = queryResults.jobReference.jobId;
// Check on status of the Query Job.