Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Juanan Pereira juananpe

🎯
Focusing
View GitHub Profile
@juananpe
juananpe / test.R
Created Mar 4, 2016
Trying to understand how to use query parameters in Shiny
View test.R
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))
@juananpe
juananpe / HelloWSS.java
Created Oct 24, 2017
Get wss://ws-feed.gdax.com stream
View HelloWSS.java
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import com.neovisionaries.ws.client.WebSocket;
import com.neovisionaries.ws.client.WebSocketAdapter;
import com.neovisionaries.ws.client.WebSocketFactory;
/**
* Mendekotasunak: (maven bidez instalatu)
* gson-2.8.2
* nv-websocket-client-2.3
View CandlestickDemo2.java
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.*;
View ChartMarketDepth.java
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 Nov 15, 2017
CryptoBrokerDB (sql)
View cryptobroker.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;
View ChartMarketDepthWithThread.java
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;
View gist:50d56d4db718b3c7c6a6a793b362c913
# 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 / DBKudeatzaile.java
Last active Dec 4, 2019
DBKudeatzaile (SQLite)
View DBKudeatzaile.java
package ehu.isad.controller.db;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.io.File;
import java.sql.Connection;
import java.sql.Statement;
@juananpe
juananpe / Proba.java
Created Nov 21, 2017
SQLIte JDBC Proba + JSON
View Proba.java
package datubasea;
import java.sql.ResultSet;
import java.sql.SQLException;
public class Proba {
public Proba() {
}