Skip to content

Instantly share code, notes, and snippets.

Avatar

Le Dinh Cuong cuongld2

View GitHub Profile
@cuongld2
cuongld2 / mutation_assessor.rs
Created Mar 24, 2021
Model for mutation assessor
View mutation_assessor.rs
extern crate reqwest;
extern crate tokio;
extern crate serde_json;
extern crate serde;
use serde::{Deserialize};
#[derive(Deserialize, Debug)]
@cuongld2
cuongld2 / main.rs
Created Mar 24, 2021
source code for crawling data from mutationassessor
View main.rs
#[path="models/mutation_assessor.rs"]
pub mod mutation_assessor;
use reqwest;
use reqwest::header::USER_AGENT;
use std::fs::File;
use std::io::{self, BufRead};
use std::path::Path;
extern crate csv;
use std::error::Error;
use csv::Writer;
@cuongld2
cuongld2 / main.rs
Created Mar 23, 2021
source code for simple alert while trading
View main.rs
#[path="models/financevietstock.rs"]
pub mod financevietstock;
use reqwest::header::CONTENT_LENGTH;
use reqwest::header::CONTENT_TYPE;
use reqwest::header::USER_AGENT;
use std::collections::HashMap;
use crate::financevietstock::FinanceResponse;
use std::time::Duration;
use async_std::task;
@cuongld2
cuongld2 / nginx.conf
Created Mar 17, 2021
nginx configuration file
View nginx.conf
user testing;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
@cuongld2
cuongld2 / main.py
Created Mar 5, 2021
code to auto publish article to dev.to
View main.py
import json
import requests
class BodyArticle(object):
def __init__(self, title, content, tags, published=False, series=None):
self.title = title
self.published = published
self.body_markdown = content
View main.py
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
Year = [2012, 2014, 2016, 2020, 2021, 2022, 2018]
Profit = [80, 75.8, 74, 65, 99.5, 19, 33.6]
data_plot = pd.DataFrame({"Year": Year, "Profit": Profit})
View gist:c7f14474b301f8db7e213ccf829bba89
version: '3.6'
services:
docker:
image: docker:dind
privileged: yes
networks:
- bagdb
volumes:
- bags:/bags:ro
- scripts:/scripts
@cuongld2
cuongld2 / main.go
Created Dec 12, 2020
convert chromosome format
View main.go
package main
import (
"encoding/csv"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"strings"
@cuongld2
cuongld2 / main.go
Created Dec 11, 2020
GraphQL request in Go
View main.go
package main
import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@cuongld2
cuongld2 / combinations.go
Last active Dec 10, 2020
Generate golang combinations
View combinations.go
package main
import (
"fmt"
"generate-queries/utils"
"github.com/mxschmitt/golang-combinations"
)
func main() {