Skip to content

Instantly share code, notes, and snippets.

View xupyprmv's full-sized avatar

Vladimir Maksimenko xupyprmv

View GitHub Profile
function generateRecord(documentId, processId, processJournalId) {
var journalRecord = new veda.IndividualModel();
journalRecord.defineProperty("rdf:type");
journalRecord.defineProperty("v-s:actor");
journalRecord.defineProperty("v-s:processJournal");
journalRecord.defineProperty("v-wf:onProcess");
journalRecord.defineProperty("v-s:onDocument");
journalRecord["rdf:type"] = [veda.ontology["v-wf:TaskGiven"]];
/* BEGIN Починить все старты маршрутов по идеям */
// Получить все идеи
var s = new veda.SearchModel("'rdf:type' == 'mnd-s-asppd:Idea'", null);
Object.getOwnPropertyNames(s.results).map( function (res_id) {
var res = s.results[res_id];
// console.log(res);
// Получить журнал
var journal = new veda.IndividualModel(res.id+'j');
journal['v-s:childRecord'].forEach(function (record) {
@xupyprmv
xupyprmv / navigation.html
Created January 20, 2016 11:51
Nested Jekyll page navigation without plugins
{% capture html %}
<ul>
{% if include.context == "/" %}
<li class="{% if page.url == "/" %}active{% endif %}">
<a href="{{ site.baseurl }}/">{{ site.title }}</a>
</li>
{% endif %}
{% assign entries = site.pages | sort: "path" %}
{% for entry in entries %}
@xupyprmv
xupyprmv / removeold.sh
Created March 4, 2014 06:28
Remove all files in specified folder older than N minutes (N is a parameter (bash, checked on Ubuntu 12.04)
#!/bin/bash
if [ $# -eq 2 ]; then
find $2 -type f -mmin +$1 -delete
else
echo "Illegal arguments. Right syntax is: removeold.sh N FOLDERPATH"
exit 1
fi
@xupyprmv
xupyprmv / automount.sh
Last active August 29, 2015 13:56
Automount a nonempty directory from /etc/fstab (bash, checked on Ubuntu 12.04)
#!/bin/sh
# Check parameter
if [ $# -eq 0 ]; then
echo "No argument specified. Right syntax is: automount.sh MOUNTPATH"
exit 1
else
# Check fstab contains folder
if cat /etc/fstab | grep $1 > /dev/null; then
# Check directory already mapped