Skip to content

Instantly share code, notes, and snippets.

View bendi's full-sized avatar

Marek Będkowski bendi

View GitHub Profile
19:42:03.795 [Test worker] INFO i.m.context.env.DefaultEnvironment - Established active environments: [local]
19:42:05.214 [Test worker] ERROR i.m.h.s.n.w.NettyServerWebSocketHandler - Error Opening WebSocket [io.micronaut.websocket.context.DefaultWebSocketBeanRegistry$DefaultWebSocketBean@7819e75f]: null
java.lang.NullPointerException: null
at io.micronaut.http.server.netty.websocket.NettyServerWebSocketHandler$1.getSubprotocol(NettyServerWebSocketHandler.java:156)
at io.micronaut.http.server.netty.websocket.ChatWebSocket.onOpen(NettyServerWebSocketHandlerTest.java:54)
at io.micronaut.http.server.netty.websocket.$ChatWebSocketDefinition$$exec1.invokeInternal(Unknown Source)
at io.micronaut.context.AbstractExecutableMethod.invoke(AbstractExecutableMethod.java:151)
at io.micronaut.core.bind.DefaultExecutableBinder$1.invoke(DefaultExecutableBinder.java:109)
at io.micronaut.http.server.netty.websocket.NettyServerWebSocketHandler.lambda$invokeExecutable$2(NettyServerWebSocketHandler.java:223)
at io.micron
package io.micronaut.http.server.netty.websocket;
import io.micronaut.context.DefaultApplicationContext;
import io.micronaut.context.event.ApplicationEventPublisher;
import io.micronaut.http.HttpHeaders;
import io.micronaut.http.HttpParameters;
import io.micronaut.http.HttpRequest;
import io.micronaut.http.bind.RequestBinderRegistry;
import io.micronaut.http.codec.MediaTypeCodecRegistry;
import io.micronaut.http.netty.websocket.NettyRxWebSocketSession;
@bendi
bendi / RedBloodCellDetection.java
Last active July 21, 2018 12:19 — forked from saudet/RedBloodCellDetection.java
Example of object detection with DL4J on images of red blood cells
package org.deeplearning4j.examples.convolution.objectdetection;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import org.bytedeco.javacv.CanvasFrame;
import org.bytedeco.javacv.OpenCVFrameConverter;
@bendi
bendi / pjsx-checkerboard.html
Last active June 23, 2016 20:45
Checkerboard watchface definition.
<!doctype html>
<html>
<head>
<title>Watchface designer (css/jsx) - export to C</title>
<link href='//fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
<link href="//pjsx.pl/css/pjsx.css" rel="stylesheet" />
</head>
<body>
<div class="editors">
<div>
#!/bin/bash
# For Ubuntu. Probably works elsewhere too.
# This script downloads the Raspbian file system into ~/rpi/chroot-raspbian-armhf
# It also chroots you into the directory, so you can act as a Raspbian user.
# This was all taken from here: http://superpiadventures.com/2012/07/development-environment/
mkdir -p ~/rpi
cd ~/rpi
@bendi
bendi / gist:c80936028b768cc2f027
Last active August 29, 2015 14:01
Install wifi dongle on raspbian #622
sudo apt-get install rfkill
wget https://dl.dropboxusercontent.com/u/80256631/8188eu-20131223.tar.gz
tar xzvf 8188eu-20131223.tar.gz
sudo cp rtl8188eufw.bin /lib/firmware/rtlwifi
sudo install -p -m 644 8188eu.ko /lib/modules/3.10.25+/kernel/drivers/net/wireless/
sudo insmod /lib/modules/3.10.25+/kernel/drivers/net/wireless/8188eu.ko
sudo depmod -a
lsmod | grep 8188
@bendi
bendi / Basic usage example
Last active September 25, 2015 02:27
Zend_Form_Decorator_JsValidation - basic usage, with validation messages in frenc
<?php
error_reporting(E_ALL|E_STRICT);
set_include_path(get_include_path() . PATH_SEPARATOR .
'./library');
require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();
//May need to have this set, the JavaScript file paths use baseUrl at the moment
//Zend_Controller_Front::getInstance()->setBaseUrl('public');
@bendi
bendi / Custom validator (PHP part)
Created February 28, 2011 19:57
Zend_Form_Decorator_JsValidation - adding custom validator (PHP side)
<?php
class My_Form_Decorator_JsValidation extends Zend_Form_Decorator_JsValidation
{
const ORDER_MY_CUSTOM = 100;
protected function handleCustomValidators($name, $msgs, $validator)
{
switch($name) {
case 'MyCustomValidator':
return array(
@bendi
bendi / Custom validator (JS part)
Created February 28, 2011 19:56
Zend_Form_Decorator_JsValidation - adding custom validator (JavaScript side)
(function() {
Zend = this.Zend || {};
Zend.Form = Zend.Form || {};
Zend.Form.Validator = Zend.Form.Validator || {};
Zend.Form.Validator.Rules = Zend.Form.Validator.Rules || {};
Zend.Form.Validator.Rules.MyCustomValidator = function(value, opts, msgs) {
if (value < opts.param) {
return msgs.notValid;
}