Skip to content

Instantly share code, notes, and snippets.

@ov7a
ov7a / kibana_to_rm.js
Created April 23, 2018 07:43
From Kibana to Redmine
(function logs_data_main(){
const ui_id = "logs_ui";
const data_id = "logs_data_ui";
function addLogsData(){
let text = document.getElementById(data_id).value;
let lines = text.split('\n');
let urlsAndNames = lines
.filter(x => x.length > 2)
@ov7a
ov7a / build.gradle
Last active February 21, 2018 08:42
build.gradle quasar kotlin app example
apply plugin: 'java'
apply plugin: 'idea'
apply plugin: 'kotlin'
buildscript {
ext.kotlin_version = '1.1.51'
ext.quasar_version = '0.7.9'
repositories {
mavenCentral()
@ov7a
ov7a / Main.kt
Last active February 21, 2018 08:41
Kotlin and quasar MWE for Unable to instrument class kotlin/SynchronizedLazyImpl https://github.com/puniverse/quasar/issues/288
package mwe
import co.paralleluniverse.fibers.Suspendable
import co.paralleluniverse.kotlin.Actor
import co.paralleluniverse.kotlin.register
import co.paralleluniverse.kotlin.spawn
import co.paralleluniverse.strands.Strand
class LazyActor : Actor() {
#coding=utf-8
import sys
vowels = u"уеаоэяиюы"
text = sys.stdin.read()
consonant = filter(lambda x: x.lower() not in vowels, text)
vows = filter(lambda x: x.lower() in vowels or x == " ", text)
print
```
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.thymeleaf.exceptions.TemplateInputException: An error happened during template parsing (template: "URL [file:./web/templates/display/ad.html]")
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:982) ~[spring-webmvc-4.3.0.BUILD-SNAPSHOT.jar:4.3.0.BUILD-SNAPSHOT]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:861) ~[spring-webmvc-4.3.0.BUILD-SNAPSHOT.jar:4.3.0.BUILD-SNAPSHOT]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687) ~[javax.servlet-api-3.1.0.jar:3.1.0]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:846) ~[spring-webmvc-4.3.0.BUILD-SNAPSHOT.jar:4.3.0.BUILD-SNAPSHOT]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) ~[javax.servlet-api-3.1.0.jar:3.1.0]
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:812) ~[jetty-servlet-9.2.17.v20160517.ja
@ov7a
ov7a / gist:6636954
Created September 20, 2013 12:47
Python2.7 ability to pipeline stdout
import codecs, sys
sys.stdout = codecs.getwriter('utf8')(sys.stdout)
print 'ololo'
sys.stdout.flush()
@ov7a
ov7a / gist:6339051
Created August 26, 2013 08:03
Python global exception hook
def log_uncaught_exceptions(ex_cls, ex, tb):
logging.critical(''.join(traceback.format_tb(tb)))
logging.critical('{0}: {1}'.format(ex_cls, ex))
os._exit(1)
sys.excepthook = log_uncaught_exceptions
def install_thread_excepthook():
"""
Workaround for sys.excepthook thread bug
(https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1230540&group_id=5470).