Skip to content

Instantly share code, notes, and snippets.

@redaktor
redaktor / dive read async
Last active August 29, 2015 13:57
dive/dojo : a snippet to itterate recursive all views in a folder, abstracted
/* we use dojo on node.js allover and here as a "promise pattern" ! : */
/* http://github.com/kitsonk/dojo-node-boilerplate */
require(["dojo/Deferred", "dojo/promise/all"], function(def, all){
var rPath, name, eStr, iStr, e, _data;
function read (file){
var d = new def();
@redaktor
redaktor / EXIF makernotes to JSON
Last active August 29, 2015 14:00
requires node.js scraper, very experimental, gives you http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/ as JSON
// http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html#CameraInfo5DmkII
var vendorToJSON = 'Nikon';
var scraper = require('scraper');
var util = require('util');
scraper('http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/'+vendorToJSON+'Custom.html', function(err, jQuery) {
if (err) {throw err}
var h2 = [];
var ta = [];
var util = require('util');
/* Extracts Canon flavored Makernotes. */
/*
// descriptor tables can be written like so
// [null, 'desc', {desc: 'FocalType', val: {0: 'AF', 1: 'Fixed', 2: 'Zoom'}}]
// or
// { 1:'desc', 2:{desc: 'FocalType', val: {0: 'AF', 1: 'Fixed', 2: 'Zoom'}}}
// which is the same for the map function
*/
@redaktor
redaktor / EXIF node-exif
Last active August 29, 2015 14:01
WIP (exiftool like)
var fs = require('fs'),
util = require('util'),
BufferExtender = require('./Buffer');
/* TODO s
# NOTE: trailing 'blanks' (spaces) are removed from all EXIF tags which
# may be 'unknown' (filled with spaces) according to the EXIF spec.
# This allows conditional replacement with 'exiftool -TAG-= -TAG=VALUE'.
# - also removed are any other trailing whitespace characters
---
SubIFD for RAWs
var util = require('util');
/*
// Extracts Nikon flavored Makernotes.
// descriptor tables can be written like so
// [null, 'desc', {desc: 'FocalType', val: {0: 'AF', 1: 'Fixed', 2: 'Zoom'}}]
// or
// { 1:'desc', 2:{desc: 'FocalType', val: {0: 'AF', 1: 'Fixed', 2: 'Zoom'}}}
// which is the same for the map function
// but to identify BIT MARKERS, use an array for val
// e.g. {desc: 'LensType', val: ['MF', 'D', 'G', 'VR']}
@redaktor
redaktor / schema.org_comments
Last active August 29, 2015 14:12
missing comments in schema.rdfs.org JSON
{
"APIReference":{
"ancestors":[
"Thing",
"CreativeWork",
"Article",
"TechArticle"
],
"comment":"Reference documentation for application programming interfaces (APIs).",
"comment_plain":"Reference documentation for application programming interfaces (APIs).",
@redaktor
redaktor / EXAMPLE.js
Last active February 12, 2024 23:18
nlp_compromise metrics proposal as standalone example
// TODO - make logic_negate and abbreviations to lexicon as resource file (i18n, language aware, seperate data and logic)
// the best way might be a dictionary with flags where we can easily derive the lexicon by Object.keys and map, like
/* dictionary: {
"CP": [
{v:'is', weak: 1},
...
],
...
};
*/
@redaktor
redaktor / dictionary.js
Last active August 29, 2015 14:20
dictionary.js
// nlp_comprimise by @spencermountain in 2014
var main = {
/* *********************************************************************************************************
// The main dictionary to build various language (or context) specific lexica -
// This list is the seed, from which various forms are conjugated and flags are determined in the lexicon
********************************************************************************************************* */
// note: the orig. lexicon was compared to redaktor translation databases
// we found a few questionable categorized like e.g. over, against (can be prepositions) etc.