Skip to content

Instantly share code, notes, and snippets.

View cuongld2's full-sized avatar

Le Dinh Cuong cuongld2

View GitHub Profile
@cuongld2
cuongld2 / main.rs
Created March 24, 2021 03:34
source code for crawling data from mutationassessor
#[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 March 23, 2021 05:11
source code for simple alert while trading
#[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 March 17, 2021 09:36
nginx configuration file
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 March 5, 2021 08:55
code to auto publish article to dev.to
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
@cuongld2
cuongld2 / main.py
Created February 18, 2021 09:41
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})
version: '3.6'
services:
docker:
image: docker:dind
privileged: yes
networks:
- bagdb
volumes:
- bags:/bags:ro
- scripts:/scripts
@cuongld2
cuongld2 / main.go
Created December 12, 2020 04:18
convert chromosome format
package main
import (
"encoding/csv"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"strings"
@cuongld2
cuongld2 / main.go
Created December 11, 2020 03:34
GraphQL request in Go
package main
import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
@cuongld2
cuongld2 / combinations.go
Last active December 10, 2020 07:12
Generate golang combinations
package main
import (
"fmt"
"generate-queries/utils"
"github.com/mxschmitt/golang-combinations"
)
func main() {
@cuongld2
cuongld2 / main.py
Created April 13, 2020 10:49
CreateUser class with graphene
class CreateUser(graphene.Mutation):
class Arguments:
username = graphene.String(required=True)
password = graphene.String(required=True)
fullname = graphene.String()
ok = graphene.Boolean()
user = graphene.Field(lambda: UserInfoSchema)
@staticmethod