Skip to content

Instantly share code, notes, and snippets.

Mirko Menegazzo mirko77

Block or report user

Report or block mirko77

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mirko77
mirko77 / address-example.json
Created Jan 18, 2018
Epicollect5 connected dropdown with jumps
View address-example.json
{
"data": {
"id": "0de0f531f7fb475487d5a71ce4174153",
"type": "project",
"project": {
"ref": "0de0f531f7fb475487d5a71ce4174153",
"name": "Address Example",
"slug": "address-example",
"forms": [
{
@mirko77
mirko77 / epicollect5-api-example.r
Created Oct 20, 2017
Fetch data from Epicollect5 API using R
View epicollect5-api-example.r
library(httr)
library(jsonlite) # if needing json format
cID<-"999" # client ID
secret<- "F00HaHa00G" # client secret
proj.slug<- "YourProjectSlug" # project slug
form.ref<- "YourFormRef" # form reference
branch.ref<- "YourFromRef+BranchExtension" # branch reference
res <- POST("https://five.epicollect.net/api/oauth/token",
@mirko77
mirko77 / Store listing
Last active Feb 20, 2020
Epicollect5 mobile app language files
View Store listing
Epicollect5 Data Collection.
Mobile & web application for free and easy data collection.
Epicollect5 is a mobile & web application for free and easy data collection hosted by Imperial College London at https://five.epicollect.net
It provides both the web and mobile application for the generation of forms (questionnaires) and freely hosted project websites for data collection.
Data are collected (including GPS and media) using multiple devices and all data can be viewed on a central server (via map, tables, charts).
View ask-confirm.js
var askConfirm = function (the_title, the_message, onConfirmCallback, has_data_to_save, the_current_input, is_branch) {
var current_input = the_current_input;
var response;
if (navigator.notification && !EC.Utils.isChrome()) {
var _confirmCallback = function (btn_index) {
console.log('btn_index: ' + btn_index);
@mirko77
mirko77 / multiline-js
Created Nov 18, 2015
Multiline js (for HTML output)
View multiline-js
//add bottom border to last element only
if (index === group_input_labels.length - 1) {
HTML += '<div class="ui-block-a group-inputs-grid__label group-inputs-grid-bottom-border">';
HTML += '<div class="ui-bar ui-bar-e" style="height:60px">' + single_label.label + '</div>';
HTML += '</div>';
} else {
HTML += '<div class="ui-block-a group-inputs-grid__label">';
HTML += '<div class="ui-bar ui-bar-e" style="height:60px">' + single_label.label + '</div>';
HTML += '</div>';
}
@mirko77
mirko77 / throttling-ajax.js
Created Oct 29, 2015
Throttling Ajax request for autocomplete
View throttling-ajax.js
//populate lists with autocomplete suggestions based on project names on the server
dom_list.on('listviewbeforefilter', function (e, data) {
console.log('typing');
var $ul = $(this);
var $input = $(data.input);
var value = $input.val();
var html = '';
@mirko77
mirko77 / epicollect5.jscs.json
Created Mar 12, 2015
epicollect5 js code style
View epicollect5.jscs.json
{
"requireCurlyBraces": [
"if",
"else",
"for",
"while",
"do",
"try",
"catch"
],
@mirko77
mirko77 / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@mirko77
mirko77 / file.php
Created Mar 7, 2015
File upload to Epicollect+ (image)
View file.php
/*
* http://plus.epicollect.net/post_image_test
* post request for single file (image)
*/
Array
(
[name] => Array
(
[name] => test_form_ecplus_test_form_ctrl2_a2439aad10124340_1425745268593.jpg
@mirko77
mirko77 / post.php
Last active Aug 29, 2015
Example of POST request to Epicollect+, project: http://plus.epicollect.net/post_image_test
View post.php
/*
* http://plus.epicollect.net/post_image_test
* post request for single entry (data)
*/
Array
(
[table] => test_form
[ecTimeCreated] => 1425745270
[ecPhoneID] => a2439aad10124340
You can’t perform that action at this time.