Skip to content

Instantly share code, notes, and snippets.

@toannd96
toannd96 / main.go
Created January 18, 2023 04:41 — forked from aliforever/main.go
telegram-bot-api pagination example
package main
import (
"fmt"
"strconv"
"strings"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
)
@toannd96
toannd96 / main.go
Created July 28, 2022 04:37 — forked from brunoluiz/main.go
rrweb-server-ui-hack
package main
// ☢️ WARNING: If you are alergic to messy cowboy codes, please don't read the code below ☢️
//
// # Intro:
//
// This snippet of magic is to test rrweb as a possible replacement to FullStory. It uses badger as storage because I
// didn't want to deal with setting up a container and migrations for storage.
// > FullStory is a tool to record user sessions for further analysis (can be for debugging, UX etc)
//
@toannd96
toannd96 / masothue.go
Last active January 8, 2022 08:48
crawl masothue.com
package main
import (
"encoding/json"
"fmt"
"net/http"
"os"
"sync"
"time"
@toannd96
toannd96 / jobstreet.go
Last active January 6, 2022 16:44
crawl jobstreet use channel, colly and goquery
package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strconv"
"sync"
@toannd96
toannd96 / StreamToString.go
Created April 15, 2021 08:29 — forked from dixudx/StreamToString.go
Golang: io.Reader stream to string or byte slice
import "bytes"
func StreamToByte(stream io.Reader) []byte {
buf := new(bytes.Buffer)
buf.ReadFrom(stream)
return buf.Bytes()
}
func StreamToString(stream io.Reader) string {
buf := new(bytes.Buffer)
@toannd96
toannd96 / client.go
Created February 23, 2021 09:16 — forked from amlwwalker/client.go
Golang Multipart upload to S3 over HTTP using tusd
package main
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"mime/multipart"
"net/http"
@toannd96
toannd96 / Virustotal_Funtional_Oriented.py
Created December 24, 2020 17:42 — forked from srinivas946/Virustotal_Funtional_Oriented.py
Functional Oriented style of program to verify the Threat Identity of an IOC provided by the user
import requests # to handle http and https requests and responses
import time # make program to sleep based on specified interval of time
# -------------------------------------
# LIST OF VIRUS TOTAL REST API'S
# -------------------------------------
IP_ADDRESS_API = "https://www.virustotal.com/vtapi/v2/ip-address/report"
DOMAIN_API = "https://www.virustotal.com/vtapi/v2/domain/report"
URL_REPORT_API = "https://www.virustotal.com/vtapi/v2/url/report"
URL_SCAN_API = "https://www.virustotal.com/vtapi/v2/url/scan"
https://www.bogotobogo.com/GoLang/GoLang_Visual_Studio_Code.php
https://golangbot.com/variables/
Tổng hợp tài liệu Golang từ cơ bản đến nâng cao cho beginner:
Trang chủ: https://golang.org
Official docs: https://golang.org/doc
Official blog: https://blog.golang.org
Training Golang cơ bản: https://tour.golang.org (Khuyến khích xem trước, rất dễ học)
@toannd96
toannd96 / app.py
Created July 14, 2018 03:26 — forked from greyli/app.py
Photo upload and manage with Flask and Flask-Uploads (Multiple file upload support!).
# -*- coding: utf-8 -*-
import os
import time
import hashlib
from flask import Flask, render_template, redirect, url_for, request
from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import SubmitField
def sum_digits(number):
str_number = str(number)
sum = 0
for i in range(0, len(str_number)):
sum += int(str_number[i])
return sum
sum_digits(2**1000)
>>>1366
sum(int(num) for num in str(2**1000)) >>> 1366