Skip to content

Instantly share code, notes, and snippets.

View jkot's full-sized avatar

Jakub Kotowski jkot

  • Prague, Czech Republic
View GitHub Profile
@jkot
jkot / maventricks.md
Last active July 2, 2021 13:16
Maven tricks

Maven tricks

Echo all available Maven properties

<plugin>
	<groupId>org.apache.maven.plugins</groupId>
	<artifactId>maven-antrun-plugin</artifactId>
	<version>1.7</version>
	
import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.concurrent.Callable;
import javassist.util.proxy.MethodHandler;
import javassist.util.proxy.ProxyFactory;
import javassist.util.proxy.ProxyObject;
import net.sf.cglib.proxy.Enhancer;
import net.sf.cglib.proxy.MethodInterceptor;
@jkot
jkot / data_processing_tricks.md
Last active August 29, 2015 14:10
Data processing tricks

Sort by line length

| awk '{ print length, $0 }' | sort -n | cut -d" " -f2-

@jkot
jkot / install-java.sh
Created December 5, 2014 16:23
Install Oracle Java
echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" > /etc/apt/sources.list.d/webupd8team-java.list
echo "deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" >> /etc/apt/sources.list.d/webupd8team-java.list
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys EEA14886
apt-get update
yes | sudo apt-get install oracle-java7-installer
java -version
@jkot
jkot / Sesame.md
Created December 5, 2014 16:25
OpenRDF Sesame
curl --form-string "context=<http://example.com/context/url>" \
     -F "Content-Type=text/x-nquads" \
     -F "source=file" \
     -F "content=@$f;type=text/x-nquads" \
     http://localhost:8080/openrdf-workbench/repositories/$REPO/add

curl --data "type=native&Repository%20ID=$REPO&Repository%20title=$REPONAME&Triple%20indexes=spoc,posc" http://localhost:8080/openrdf-workbench/repositories/NONE/create
@jkot
jkot / Virtuoso.md
Last active July 14, 2016 18:45
Virtuoso

Virtuoso tips and tricks

Virtuoso settings for retrieving large result sets

[Parameters]
MaxSortedTopRows                = 250000
 
[SPARQL]
ResultSetMaxRows = 10000000
@jkot
jkot / gist:8ca24f814e72e88dc51f
Created January 6, 2015 16:39
IntelliJ IDEA and Node.js, nvm, grunt, bower

Node.js installed via nvm: follow directions at https://github.com/creationix/nvm, then nvm install 0.10

Install grunt and bower globally npm install -g grunt-cli bower

Node, grunt, bower, npm executables are then in e.g. ~/.nvm/v0.10.35/bin

In IDEA go to Settings -> Languages & Frameworks -> Node.js and NPM and set "Node interpreter" to e.g. /home/jakub/.nvm/v0.10.35/bin/node

@jkot
jkot / sparql.md
Last active August 29, 2015 14:16
SPARQL
insert data {
	GRAPH <http://jakub/graph> {
		<http://id/1> <http://example.com/ont#label> "1" .
		<http://id/1> <http://example.com/ont#label> "x" .
		<http://id/2> <http://example.com/ont#label> "2" .
	}
}
@jkot
jkot / history_histogram.sh
Created March 10, 2015 23:58
history histogram
history|awk '{print $2}'|sort|uniq -c|sort -rn|head -20|awk '!max{max=$1;}{r="";i=s=60*$1/max;while(i-->0)r=r"#";printf "%15s %5d %s %s",$2,$1,r,"\n";}'