Skip to content

Instantly share code, notes, and snippets.

View mitselek's full-sized avatar

Mihkel Putrinš mitselek

View GitHub Profile
@mitselek
mitselek / 0_reuse_code.js
Created January 21, 2014 08:05
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
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 '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
5 verbose installManyTop reading scoped package data from C:\Users\Michelek\Documents\GitHub\panustaja\node_modules\async\package.json
6 verbose installManyTop reading scoped package data from C:\Users\Michelek\Documents\GitHub\panustaja\node_modules\electron-jade\package.json
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
> 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
@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"
},
@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}

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;
{
"sourceMedia": "http://vimeo.com/166032416",
"stills": {
"00:13": {
"fields": {
"geoTag": {
"latitude": 57.663,
"longitude": 10.395,
"precision": "2km",
"label": "Kandestederne"
@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}))
---------- 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