Skip to content

Instantly share code, notes, and snippets.

View mitselek's full-sized avatar

Mihkel Putrinš mitselek

View GitHub Profile
@mitselek
mitselek / screenwerk ajaarvestus
Last active February 6, 2018 13:28
Screenwerk ajaarvestus
---------- 2017-10-27 - 2018-02-06: 8h - Wõrgu Wõlurid OÜ arve nr. M-18007
2017-11-11 - 1h
player - #434a7bc add play() and pause() to first URL media prior to trashing it
2017-11-07 - 3h
player - #f041392 workaround to fix issue of first URL media failing to load DOM
2017-10-27 - 4h
player - implement restart on publish
@mitselek
mitselek / sane.sh
Created September 19, 2017 11:09
get rid of MS-WORD accentures
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/a\x{0308}/\x{00E4}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/A\x{0308}/\x{00C4}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/o\x{0308}/\x{00F6}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/O\x{0308}/\x{00D6}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/u\x{0308}/\x{00FC}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/U\x{0308}/\x{00DC}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/o\x{0303}/\x{00F5}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/O\x{0303}/\x{00D5}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/s\x{030C}/\x{0161}/g'
find ./R6-nimed.txt -type f | xargs perl -CSD -i -pe 's/S\x{030C}/\x{0160}/g'
---------- 2019-05-10 - 2019-06-10: 3h - Wõrgu Wõlurid OÜ arve nr. M-19034
2019-05-10 - 3h
- pprint - consulting Piletilevi programmers
---------- 2019-02-03 - 2019-03-18: 12h - Wõrgu Wõlurid OÜ arve nr. M-19021
2019-03-18 - 2h
- pprint - hand over repository to Piletilevi programmers
- update compile script
@mitselek
mitselek / intersect.js
Created November 23, 2016 11:05
Test if two segments intersect
function intersect(a,b,c,d) {
var a_cd = (d.x - c.x) * (a.y - c.y) > (d.y - c.y) * (a.x - c.x)
var b_cd = (d.x - c.x) * (b.y - c.y) > (d.y - c.y) * (b.x - c.x)
var c_ab = (b.x - a.x) * (c.y - a.y) > (b.y - a.y) * (c.x - a.x)
var d_ab = (b.x - a.x) * (d.y - a.y) > (b.y - a.y) * (d.x - a.x)
return a_cd !== b_cd && c_ab !== d_ab
}
console.log(intersect({x:0,y:0},{x:1,y:1},{x:1,y:0},{x:0,y:1}))
{
"sourceMedia": "http://vimeo.com/166032416",
"stills": {
"00:13": {
"fields": {
"geoTag": {
"latitude": 57.663,
"longitude": 10.395,
"precision": "2km",
"label": "Kandestederne"

Media-tag

An independent sessionless, userless, storageless HTML5 app for adding rich metadata to different media types. Actually any file or internet address could be annotated by this convention.

Scope

There are often situations, where some media needs to be annotated and EXIF is not really helpful because its only relevant for single picture.

  • add geolocation, timestamps, links, descriptions, titles etc to media (like EXIF, but universal for all media types);
  • mark regions on media;
  • add multilingual subtitles to videos;
  • create in-video navigation;
@mitselek
mitselek / annoteerija.md
Last active June 13, 2016 11:46
Meedia annoteerimiskeskkonna visand

Teenus on iseseisev HTML äpp.

Ilma sessioonita, kasutajata, andmebaasita. Peaasi, et ta kuskilt veebis kätte on saada - ntx github pages.

Teenuse poole pöördudes annab teenust kasutav keskkond (tellija) kaasa:

  • teenust kasutav keskkond genereerib enda poolt allkirjastatud JWT tokeni, kuhu ta lisab endale tarviliku info, et ära tunda ja valideerida teenuse poolt kunagi hiljem saadav vastus (kasutaja, meedia ID, mida annoteeritakse, tokeni kehtivusaeg, ...)
  • API URL .../api/annotate/configuration, kust teenus tirib endale konfiguratsiooni

Teenus teeb päringu GET .../api/annotate/configuration/{JWT token}

@mitselek
mitselek / mediaTagConf.json
Last active June 14, 2016 08:34
Configuration for media annotation
{
"sourceMedia": "http://vimeo.com/166032416",
"submit": {
"label": "Save",
"target": "https://intiator.com/api/annotate/annotate/submit"
},
"reSubmit": {
"label": "Change",
"target": "https://intiator.com/api/annotate/annotate/submit"
},
> mmmagic@0.4.1 install C:\Users\Michelek\Documents\GitHub\panustaja\node_modules\mmmagic
> node-gyp rebuild
C:\Users\Michelek\Documents\GitHub\panustaja\node_modules\mmmagic>if not defined npm_config_node_gyp (node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.targets(44,5): error MSB8020: The builds tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install v140 to build using the v140 build tools. [C:\Users\Michelek\Documents\GitHub\panustaja\node_modules\mmmagic\build\deps\libmagic\libmagic.vcxproj]
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.Cpp.Platform.t
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files (x86)\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '--loglevel',
1 verbose cli 'silly',
1 verbose cli 'mmmagic' ]
2 info using npm@2.14.7
3 info using node@v4.2.2
4 verbose install initial load of C:\Users\Michelek\Documents\GitHub\panustaja\package.json