Skip to content

Instantly share code, notes, and snippets.

View matejuh's full-sized avatar
😅
QNGv2

Matej Plch matejuh

😅
QNGv2
View GitHub Profile
@matejuh
matejuh / IPAdapter-impl.js
Last active December 30, 2015 18:59
Worklight showcase
function getMyAddress() {
var input = {
method : 'get',
returnedContentType : 'json',
path : "json"
};
return WL.Server.invokeHttp(input);
}
@matejuh
matejuh / gist:5196313
Last active December 15, 2015 03:39
Embedded Teiid. The second file is working example.
package com.ca.teiid;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.resource.cci.ConnectionFactory;
import javax.xml.ws.Service.Mode;
public void HelloWorld(){
System.out.println("Hello World");
}
@matejuh
matejuh / gist:4551004
Created January 16, 2013 21:11
Create Spring Roo Hello world project with automatic generated json API.
project --topLevelPackage cz.spring.swagger
persistence setup --database H2_IN_MEMORY --provider HIBERNATE
entity jpa --class cz.spring.swagger.domain.Word
field string --fieldName name --notNull true --unique true
field string --fieldName definition --notNull true
json all
controller all --package cz.spring.swagger.controller
web mvc json all
exit
matej@notebook:~/Downloaded/git_test_repo$ mkdir /home/matej/Images/test1
matej@notebook:~/Downloaded/git_test_repo$ touch /home/matej/Images/test1/foo1
matej@notebook:~/Downloaded/git_test_repo$ mkdir /home/matej/Documents/test2
matej@notebook:~/Downloaded/git_test_repo$ touch /home/matej/Documents/test2/foo2
matej@notebook:~/Downloaded/git_test_repo$ cd ..
matej@notebook:~/Downloaded$rm -rd git_test_repo
matej@notebook:~/Downloaded$ mkdir git_test_repo
matej@notebook:~/Downloaded$ git --git-dir=./git_test_repo/ init
Initialized empty Git repository in /home/matej/Downloaded/git_test_repo/
@matejuh
matejuh / nfdump_bindata.rb
Created April 23, 2012 20:40
Ukázka načítání nfdump souboru pomocí knihovny BitStruct a BinData
require 'bindata'
class FlowFileHeader < BinData::Record
endian :little
uint16 :magic
uint16 :version
uint32 :flags
uint32 :numBlocks
string :ident, :read_length => 128
@matejuh
matejuh / FixtureTest.java
Created February 23, 2012 12:40
play-siena relationship
import static org.junit.Assert.*;
import java.util.ArrayList;
import java.util.List;
import models.Flight;
import models.Parent;
import models.Thing;
import org.junit.After;
@matejuh
matejuh / dynamic.cgi
Created February 22, 2012 09:02
RRD CGI with dynamic given values
#!/usr/local/rrdtool/bin/rrdcgi
<html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<head>
<title>Dynamic ratio</title>
</head>
<body>
<h1>Dynamic ratio</h1>
<div>
<p>
@matejuh
matejuh / embedded.c
Created February 1, 2012 09:10
Embedded Ruby gems- gem path
#Inspired by Ruby sources gem initialization
void defineRuby() {
void Init_prelude(void);
RUBY_INIT_STACK;
ruby_init();
ruby_init_loadpath();
ruby_script("embed traffic profiller");
rb_define_module("Gem");
@matejuh
matejuh / embed.c
Created January 20, 2012 09:33 — forked from mattwildig/embed.c
Wrapping struct
/*
N.B. this program doesn't include any error checking. In particular you'll have
to do all the rb_protect stuff
*/
#include <stdio.h>
#include "ruby.h"
struct Address {
char * town;