Skip to content

Instantly share code, notes, and snippets.

@mah0001
mah0001 / create-project-for-ME-using-python.md
Created March 14, 2025 19:55
Create new project for metadata editor using Python

Creata new project [timeseries] for Metadata Editor using Python

This example uses the Python's requests library.

Warning

NEVER store API keys within the code. Use ENV variables or other options to make sure the API keys are kept separately from the code.

Create a new project for timeseries

@mah0001
mah0001 / create-using-metadataeditorR.md
Created March 14, 2025 19:33
Create a new project using MetadataEditR package

Create new projects using MetadataEditR R package

Load metadataeditr package

library(metadataeditr)
metadataeditr::set_api_key("paste-your-key")
metadataeditr::set_api_url("https://editor-website/index.php/api")
CREATE TABLE widgets (
id int NOT NULL identity(1,1),
uuid varchar(100) NOT NULL,
title varchar(250) NOT NULL,
thumbnail varchar(300) DEFAULT NULL,
@mah0001
mah0001 / form.json
Last active February 10, 2017 16:35 — forked from anonymous/form.json
A saved configuration for a schema form example, http://textalk.github.io/angular-schema-form/examples/bootstrap-example.html
[
{
"_schema": "ddi2 codebook",
"_title": "DDI2 IHSN template",
"_description": "Template for Survey data type based on DDI 2.5",
"type": "fieldset",
"htmlClass": "form_fieldset form-fieldset-toggle",
"title": "Document",
"onClick": "toggle()",
"items": [
@mah0001
mah0001 / get-xml-paths.php
Created April 9, 2014 18:39
Get all XML paths using PHP/SimpleXML
<?php
//usage
$paths_array=$print_paths("path-to-xml-file");
var_dump($paths_array);
function print_paths($xml_file)
@mah0001
mah0001 / curl-partial-download.php
Created June 15, 2012 01:23
Partial downloading of files using CURL with PHP
/**
*
* Using CURL to download partial content from a URL
*
* @url file URL to download
* @range_start Start range in bytes
* @range_end End range in bytes
*
*
* example: curl_get_content("http://www.example.org/some-file.zip",100,500)