Skip to content

Instantly share code, notes, and snippets.

@slaporte
slaporte / Code.gs
Created November 15, 2020 00:46
Google Apps Script to send an email (from a Doc template) based on a response to a form. Used for Wiki Loves Monuments email confirmation.
/**
* Based on: https://github.com/googleworkspace/solutions/blob/master/content-signup/src/Code.js
*/
var EMAIL_TEMPLATE_DOC_URL = 'https://docs.google.com/document/d/***/edit?usp=sharing';
var EMAIL_SUBJECT = '[Response requested] Please confirm your Wiki Loves Monuments winners';
var CC_RECIPIENTS = 'lodewijk@effeietsanders.org, erinamukuta@gmail.com'
/**
* Installs a trigger on the Spreadsheet for when a Form response is submitted.

Public

  • login
  • get default series
  • get list of all series
  • add frontend error log
  • view docs
  • view report
  • logout

Organizer

-- MySQL dump 10.16 Distrib 10.1.41-MariaDB, for debian-linux-gnu (x86_64)
--
-- Host: tools-db Database: s53490__montage
-- ------------------------------------------------------
-- Server version 10.1.39-MariaDB
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
Filename
À_bord_d'un_méthanier.jpg
Échassier_2_en_animation_lors_du_grand_spectacle_du_cinquantenaire_de_l'église_des_martyres_de_l'Ouganda_à_Dakar_(Sénégal).jpg
Échassier_en_animation_lors_du_grand_spectacle_du_cinquantenaire_de_l'église_des_martyres_de_l'Ouganda_à_Dakar_(Sénégal).jpg
3_picou_from_3_caminhu_in_the_direction_of_Asomada_city.jpg
Activité_sportive_à_l'UAC-Bénin.jpg
Après_la_pluie_dans_une_von_d'Ayimèvo.jpg
Artiste_danseur_contemporain_lors_du_grand_spectacle_du_cinquantenaire_de_l'église_des_martyres_de_l'Ouganda_à_Dakar_(Sénégal).jpg
Artiste_danseur_imitant_le_kankourang_des_rites_Diola_lors_du_grand_spectacle_du_cinquantenaire_de_l'église_des_martyres_de_l'Ouganda_à_Dakar_(Sénégal).jpg
Artistes_acrobates_2_lors_du_grand_spectacle_du_cinquantenaire_de_l'église_des_martyres_de_l'Ouganda_à_Dakar_(Sénégal).jpg

Verifying your imports in Montage

Did you import a list of files into Montage, but do not see the right number of entries in the round? Your source list may have had some improper files names, typos, or moved/deleted files. Here is what you can do:

  • If you need to confirm the import worked at all, look at the Audit Logs (if you have permission) by visiting https://tools.wmflabs.org/montage/v1/logs/audit?round_id=<ROUND ID>&limit=100
  • Get the list of round entries in your browser at https://tools.wmflabs.org/montage/v1/admin/round/<ROUND ID>/entries or download a CSV of the round entries at https://tools.wmflabs.org/montage/v1/admin/round/<ROUND ID>/entries/download
  • Compare your source list against the round entries, using a tool like this.
    • Are any of the filenames malformed in the source list?
    • Have any of the files moved? Been deleted?
  • Do you mistakenly include a full URL?
@slaporte
slaporte / gist:f18afef811f1b7a6a0e0d1f03a849bd5
Created February 18, 2018 05:34
WLA17 - Round II (minus Egypt)
filename
Cameroon_male_plumbier_at_work_04.jpg
Formation_eleves.jpg
Selling_red_palm_oil_in_a_market.jpg
Couturière_dans_son_atelier.jpg
Mechanic_at_work_2.jpg
Ouvrier_au_travail_au_port_de_Douala_2.jpg
Carpenter_at_work_2.jpg
Une_fermière_dans_sa_ferme_avec_de_gros_poulets.jpg
Ouvriers_Routiers_14.jpg
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `complete_log` (
`complete_log_id` int(11) NOT NULL AUTO_INCREMENT,
`complete_timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`lang` varbinary(8) DEFAULT NULL,
`output` varbinary(4096) DEFAULT NULL,
`run_uuid` varbinary(36) DEFAULT NULL,
PRIMARY KEY (`complete_log_id`),
KEY `complete_timestamp` (`complete_timestamp`),
@slaporte
slaporte / work-allocation.md
Last active October 14, 2017 22:55
Montage work allocation

Custom work allocation in Montage

Input

  • List of new jurors, with both username and work allocation
  • List of old jurors to discard votes: the default approach will be to preserve votes
  • Quorum: if the new quorum is less than the existing quorum, then we also need a discard strategy. We can either discard randomly, or keep best votes

Work allocation

We can't make this file beautiful and searchable because it's too large.
img_name,img_size,img_width,img_height,img_metadata,img_bits,img_media_type,img_major_mime,img_minor_mime,img_description,img_user,img_user_text,img_timestamp,img_sha1,page_id,page_namespace,page_title,page_restrictions,page_counter,page_is_redirect,page_is_new,page_random,page_touched,page_links_updated,page_latest,page_len,page_no_title_convert,page_content_model,cl_from,cl_to,cl_sortkey,cl_timestamp,cl_sortkey_prefix,cl_collation,cl_type
009.jpg.Fontpédrouse.jpg,2120159,3858,2572,"a:9:{s:11:""XResolution"";s:5:""240/1"";s:11:""YResolution"";s:5:""240/1"";s:14:""ResolutionUnit"";i:2;s:10:""ImageWidth"";s:4:""3858"";s:11:""ImageLength"";s:4:""2572"";s:15:""PixelXDimension"";s:4:""3858"";s:15:""PixelYDimension"";s:4:""2572"";s:12:""WebStatement"";s:0:"""";s:22:""MEDIAWIKI_EXIF_VERSION"";i:2;}",8,BITMAP,image,jpeg,User created page with UploadWizard,5153337,Meria Geoian,20150917094137,nbib6b2nizcdxhh9gtptt8iz6otpjh9,43327146,6,009.jpg.Fontpédrouse.jpg,,0,0,0,0.747347188635,20160828073008,20160813202807,1766335