Skip to content

Instantly share code, notes, and snippets.

View duyet's full-sized avatar

duyet duyet

View GitHub Profile
@duyet
duyet / Apple_mobile_device_types.txt
Created January 4, 2023 04:52 — forked from adamawolf/Apple_mobile_device_types.txt
List of Apple's mobile device codes types a.k.a. machine ids (e.g. `iPhone1,1`, `Watch1,1`, etc.) and their matching product names
i386 : iPhone Simulator
x86_64 : iPhone Simulator
arm64 : iPhone Simulator
iPhone1,1 : iPhone
iPhone1,2 : iPhone 3G
iPhone2,1 : iPhone 3GS
iPhone3,1 : iPhone 4
iPhone3,2 : iPhone 4 GSM Rev A
iPhone3,3 : iPhone 4 CDMA
iPhone4,1 : iPhone 4S
https://drive.google.com/file/d/148TyjP4q513ts19mNi6SnB6rNUgJWVo4/view?usp=sharing
@duyet
duyet / postgres_queries_and_commands.sql
Created May 9, 2022 14:07 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(clock_timestamp(), query_start), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
let resp = await fetch('http://wttr.in')
if (resp.ok) {
console.log(await resp.text())
}
from datetime import datetime
from airflow.models import DAG
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
DAG_OWNER = '[email protected]'
DAG_ID = 'dag_name'
SCHEDULE_INTERVAL = '@weekly'
@duyet
duyet / udp_server.py
Created January 3, 2020 04:56 — forked from majek/udp_server.py
Simple python udp server
import logging
import socket
log = logging.getLogger('udp_server')
def udp_server(host='127.0.0.1', port=1234):
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
@duyet
duyet / test_dags.py
Created October 17, 2019 07:47 — forked from criccomini/test_dags.py
test_dags.py
import os
import unittest
from airflow.models import DagBag
class TestDags(unittest.TestCase):
"""
Generic tests that all DAGs in the repository should be able to pass.
"""
https://drive.google.com/drive/folders/1ImgU5xnmgETI8QNr3KnwZHo0-UZk-QmR?usp=sharing