Skip to content

Instantly share code, notes, and snippets.

View tuannrio's full-sized avatar
🔗
We are team !!

Tuấn Nguyễn tuannrio

🔗
We are team !!
  • Hà Nội
View GitHub Profile
@jxlil
jxlil / verify_hotmail_accounts.py
Last active July 30, 2022 08:13
Verify hotmail accounts
import requests
import re
# we obtain the necessary data to make the query
session = requests.session()
resp = session.get("https://login.live.com/login.srf")
url = re.findall(r"bh:.([a-z:/.A-Z?0-9=&-]*)", resp.text)[0]
token = re.findall('name="PPFT" id=".+?" value="(.+?)"', resp.text)[0]
cookies = resp.cookies
@thanhdatvo
thanhdatvo / gofiber-chained-middlewares.go
Created April 30, 2020 20:51
Go Fiber chained middlewares
func main() {
// initialization codes
app.Get("/verify/:status/:role/:userId", authenticate, authorize, func(c *fiber.Ctx) {
if c.Locals("isAuthenticated") == false {
c.Status(403)
c.Send("Unauthenticated. Please signup!")
return
}
c.Send("Redirecting " + c.Locals("redirectRoute").(string))
@tanaikech
tanaikech / submit.md
Last active January 5, 2025 06:09
Simple Script of Resumable Upload with Google Drive API for Node.js

Simple Script of Resumable Upload with Google Drive API for Node.js

This is a simple sample script for achieving the resumable upload to Google Drive using Node.js. In order to achieve the resumable upload, at first, it is required to retrieve the location, which is the endpoint of upload. The location is included in the response headers. After the location was retrieved, the file can be uploaded to the location URL.

In this sample, a PNG file is uploaded with the resumable upload using a single chunk.

Sample script

Before you use this, please set the variables.

@sebastianwebber
sebastianwebber / pg-notify-parallel.go
Last active September 19, 2024 02:43
postgres listen/notifiy with golang and `go-pg`
package main
import (
"log"
"time"
"github.com/go-pg/pg"
)
const maxWorkers = 5
import { google } from 'googleapis';
/*******************/
/** CONFIGURATION **/
/*******************/
const googleConfig = {
clientId: process.env.GOOGLE_CLIENT_ID, // e.g. asdfghjkljhgfdsghjk.apps.googleusercontent.com
clientSecret: process.env.GOOGLE_CLIENT_SECRET, // e.g. _ASDFA%DFASDFASDFASD#FAD-
redirect: process.env.GOOGLE_REDIRECT_URL, // this must match your google api settings
@zthxxx
zthxxx / Activate Office 2019 for macOS VoL.md
Last active May 6, 2025 14:21
crack activate Office on mac with license file
@Pulimet
Pulimet / AdbCommands
Last active May 5, 2025 23:59
Adb useful commands list
Hi All!
I've recently launched a tool that wraps many of the commands here with a user interface. This desktop application is currently available for macOS. There's a roadmap outlining planned features for the near future.
Feel free to request any features you'd like to see, and I'll prioritize them accordingly.
One of the most important aspects of this application is that every command executed behind the scenes is displayed in a special log section. This allows you to see exactly what’s happening and learn from it.
Here's the link to the repository: https://github.com/Pulimet/ADBugger
App Description:
ADBugger is a desktop tool designed for debugging and QA of Android devices and emulators. It simplifies testing, debugging, and performance analysis by offering device management, automated testing, log analysis, and remote control capabilities. This ensures smooth app performance across various setups.
@jofftiquez
jofftiquez / firebase-admin-multi-apps-init-ES6.md
Last active January 8, 2025 21:17
Firebase admin - how to initialise multiple applications in ES6 nodejs.

Firebase Admin Multi App Initialization - ES6

This is a snippet that uses firebase's firebase-admin to initialize multiple firebase projects in one admin application.

ES5 version

Using ES6

import 'firebase';
@tomysmile
tomysmile / mac-setup-redis.md
Last active May 5, 2025 13:06
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@fritzy
fritzy / 1_triggers.sql
Last active March 16, 2025 15:06
Get table change notifications from Postgres as JSON
CREATE OR REPLACE FUNCTION table_update_notify() RETURNS trigger AS $$
DECLARE
id bigint;
BEGIN
IF TG_OP = 'INSERT' OR TG_OP = 'UPDATE' THEN
id = NEW.id;
ELSE
id = OLD.id;
END IF;
PERFORM pg_notify('table_update', json_build_object('table', TG_TABLE_NAME, 'id', id, 'type', TG_OP)::text);