Skip to content

Instantly share code, notes, and snippets.

View thinhdanggroup's full-sized avatar

thinhda thinhdanggroup

View GitHub Profile
@thinhdanggroup
thinhdanggroup / decodeGrpc4Http.java
Created August 21, 2019 15:20
Decode Grpc For Http
package com.thinhda.spring.grpc.core.config;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.converter.protobuf.ProtobufJsonFormatHttpMessageConverter;
import org.springframework.web.filter.CommonsRequestLoggingFilter;
@Data
@Configuration
@thinhdanggroup
thinhdanggroup / ping.proto
Created August 21, 2019 15:12
ping proto service
syntax = "proto3";
// options for Java generated sources
option java_multiple_files = true;
option java_package = "com.thinhda.spring.grpc.core.model";
option java_outer_classname = "CoreGrpcApi";
package sms.core;
message PingRequest {
PreparedStatement ps = connection.prepare("SOME SQL");
for (Data data : dataList) {
ps.setInt(1, data.getId());
ps.setString(2, data.getValue();
ps.executeUpdate();
}
ps.close();
@thinhdanggroup
thinhdanggroup / Dockerfile
Created October 12, 2018 03:47
Dockerfile for create react app
FROM node:8
# Override the base log level (info).
ENV NPM_CONFIG_LOGLEVEL warn
# Install and configure `serve`.
RUN npm install -g serve
CMD serve -s build
EXPOSE 5000
@thinhdanggroup
thinhdanggroup / fix_bug_play_video_firefox_quantum.md
Last active June 9, 2018 02:43
fix bug play video firefox quantum

Fix bug video Firefox

This is how to install Adobe Flash Plugin for Firefox:

  1. Go to https://get.adobe.com/flashplayer/ and select the option .tar.gz for other Linux. Download the file.
  2. Unpack the tar.gz file. Once unpacked you will see the following: libflashplayer.so /usr
@thinhdanggroup
thinhdanggroup / Install_nodejs.md
Last active March 13, 2022 03:51
Fastest way to install newest nodejs

Requirement

  1. Download lastest version in homepage

http://nodejs.org

Install

  1. Extract file

tar -xvf node-*.tar.xz

GitHub Token: 9887bf3d5c8bbd1c2ce53085976089ad34aef979
GitHub Gist: f054b73a78781e661f46dc62770ed7c0
GitHub Gist Type: Secret
@thinhdanggroup
thinhdanggroup / lcard_threshold.r
Created March 31, 2018 10:31
lcard algorithm
library(ggplot2)
library(utiml)
# Use stdout as per normal...
print("Hello, world!")
fixed_threshold.default <- function(prediction, threshold = 0.5,
probability = FALSE) {
if (length(threshold) == 1) {
threshold <- rep(threshold, ncol(prediction))
}
@thinhdanggroup
thinhdanggroup / pcut.r
Created March 31, 2018 09:18
pcut algorithms
library(ggplot2)
library(utiml)
print("Hello, world!")
pcut_thresholdk <- function (prediction, ratio, probability = FALSE) {
UseMethod("pcut_thresholdk")
}
@thinhdanggroup
thinhdanggroup / mcut.r
Last active March 31, 2018 09:18
mcut algorithms
library(ggplot2)
library(utiml)
# Use stdout as per normal...
print("Hello, world!")
mcut_thresholdk <- function (prediction, probability = FALSE) {
UseMethod("mcut_thresholdk")
}