Skip to content

Instantly share code, notes, and snippets.

View juananpe's full-sized avatar
🎯
Focusing

Juanan Pereira juananpe

🎯
Focusing
View GitHub Profile
@juananpe
juananpe / test.R
Created March 4, 2016 09:49
Trying to understand how to use query parameters in Shiny
library(shiny)
library(RMySQL)
source("keys.R")
con <- dbConnect( MySQL(), user=login, password=pass, db=database, host=host)
print(paste("Default:", groupId))
res <- dbSendQuery(con, paste('SELECT user_id, user_name
FROM info i , enrolment e
where i.user_id = e.fk_user_id and e.fk_group_id = ', groupId))
package graphics;
import org.jfree.chart.*;
import org.jfree.chart.axis.*;
import org.jfree.chart.plot.XYPlot;
import org.jfree.chart.renderer.xy.CandlestickRenderer;
import org.jfree.data.xy.*;
import javax.swing.*;
import java.awt.*;
@juananpe
juananpe / ChartMarketDepth.java
Created November 15, 2017 07:37
ChartMarketDepth
package graphics;
import java.awt.GridLayout;
import java.awt.LayoutManager;
import javax.swing.JFrame;
import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartPanel;
import org.jfree.chart.JFreeChart;
@juananpe
juananpe / cryptobroker.sql
Last active November 15, 2017 07:51
CryptoBrokerDB (sql)
CREATE DATABASE `cryptobroker` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
CREATE TABLE `transactions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`message` json NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
package graphics;
import java.awt.Color;
import java.awt.GridLayout;
import java.awt.LayoutManager;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.Date;
# this is a copay/paste combination of https://gist.github.com/nictuku/13afc808571e742d3b1aaa0310ee8a8d & https://gist.github.com/Rahul91/f051a391fac62ccebb581370b0ac644d
# so that we can install virtualbox via apt-get
for x in xenial xenial-security xenial-updates; do
egrep -qe "deb-src.* $x " /etc/apt/sources.list || echo "deb-src http://archive.ubuntu.com/ubuntu ${x} main universe" | sudo tee -a /etc/apt/sources.list
done
echo "deb http://download.virtualbox.org/virtualbox/debian xenial contrib" | sudo tee -a /etc/apt/sources.list.d/virtualbox.list
wget -q https://www.virtualbox.org/download/oracle_vbox_2016.asc -O- | sudo apt-key add -
# allow us to make a kernel
@juananpe
juananpe / Proba.java
Created November 21, 2017 22:32
SQLIte JDBC Proba + JSON
package datubasea;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Proba {
public Proba() {
}
@juananpe
juananpe / person.png
Last active November 28, 2017 12:01
person.png
person.png
@juananpe
juananpe / assembly.xml
Created November 28, 2017 12:45
pom.xml assembly-plugin
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<archive>
<manifest>
<mainClass>hasiera.Taula</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
@juananpe
juananpe / pom.xml
Created November 30, 2017 12:22
Proiektuan erabiltzeko pom.xml fitxategia (maven)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>Taulak</groupId>
<artifactId>Taulak</artifactId>
<version>0.0.1-SNAPSHOT</version>
<build>
<directory>target</directory>
<outputDirectory>target/classes</outputDirectory>
<finalName>${artifactId}-${version}</finalName>