Skip to content

Instantly share code, notes, and snippets.

View Ppang0405's full-sized avatar
🎣
Tet holiday

Jeremy Ppang0405

🎣
Tet holiday
  • Hanoi
View GitHub Profile
anyio==3.6.2 ; python_version >= "3.9" and python_version < "3.12"
args==0.1.0 ; python_version >= "3.9" and python_version < "3.12"
certifi==2022.12.7 ; python_version >= "3.9" and python_version < "3.12"
charset-normalizer==3.1.0 ; python_version >= "3.9" and python_version < "3.12"
click==8.1.3 ; python_version >= "3.9" and python_version < "3.12"
clint==0.5.1 ; python_version >= "3.9" and python_version < "3.12"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "3.12" and sys_platform == "win32" or python_version >= "3.9" and python_version < "3.12" and platform_system == "Windows"
deta==1.1.0 ; python_version >= "3.9" and python_version < "3.12"
dnspython==2.3.0 ; python_version >= "3.9" and python_version < "3.12"
email-validator==1.3.1 ; python_version >= "3.9" and python_version < "3.12"
anyio==3.6.2 ; python_version >= "3.9" and python_version < "4.0"
args==0.1.0 ; python_version >= "3.9" and python_version < "4.0"
certifi==2022.12.7 ; python_version >= "3.9" and python_version < "4.0"
charset-normalizer==3.1.0 ; python_version >= "3.9" and python_version < "4"
click==8.1.3 ; python_version >= "3.9" and python_version < "4.0"
clint==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
colorama==0.4.6 ; python_version >= "3.9" and python_version < "4.0" and sys_platform == "win32" or python_version >= "3.9" and python_version < "4.0" and platform_system == "Windows"
dnspython==2.3.0 ; python_version >= "3.9" and python_version < "4.0"
email-validator==1.3.1 ; python_version >= "3.9" and python_version < "4.0"
fastapi==0.95.0 ; python_version >= "3.9" and python_version < "4.0"
# https://github.com/realpython/python-speech-recognition/blob/master/guessing_game.py
import random
import time
import speech_recognition as sr
def recognize_speech_from_mic(recognizer, microphone):
"""Transcribe speech from recorded from `microphone`.
@Ppang0405
Ppang0405 / admin.py
Created January 15, 2023 16:09 — forked from herbps10/admin.py
Setting up SQLAlchemy with Application Factory pattern and Blueprints
from flask import current_app, Blueprint, render_template
from database import db_session
from model import Product
admin = Blueprint('admin', __name__, url_prefix='/admin')
@admin.route('/')
def index():
product = db_session.query(Product).first()
interface AnalyticsPayload {
username: string;
lastname: string;
firstname: string;
location: string;
}
const getIpAddress = async () => {
try {
const response = await fetch('https://api.ipify.org');

Create a new project

poetry new <project-name>

Add a new lib

potry add <library>

Remove a lib

#!/usr/bin/env /Users/truongnguyen/.asdf/shims/python
# coding: UTF-8
import requests
icons = dict({
"01d":"☀️" ,
"02d":"⛅️" ,
"03d":"☁️" ,
"04d":"☁️" ,
@Ppang0405
Ppang0405 / install.sh
Created November 24, 2021 13:26 — forked from marklit/install.sh
Bot Detection Script. Works with Apache and Nginx Log Files.
sudo apt-get update
sudo apt-get install \
python-dev \
python-pip \
python-virtualenv
virtualenv findbots
source findbots/bin/activate
curl -O http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz
@Ppang0405
Ppang0405 / AndroidManifest.xml
Created November 10, 2021 12:30 — forked from Venryx/AndroidManifest.xml
Record audio on Android in the background (even when screen is off)
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.myapp">
<application android:allowBackup="true" android:icon="@mipmap/ic_launcher android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme">
<service android:name=".ForegroundService" android:enabled="true" android:exported="true"></service>
<activity
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"