Skip to content

Instantly share code, notes, and snippets.

View tudoanh's full-sized avatar

Đỗ Anh Tú tudoanh

View GitHub Profile
@anhtran
anhtran / commands.sql
Last active September 13, 2024 03:09
Cách tạo cấu hình cho tiếng Việt trong PostgreSQL (stopwords, ispell)
CREATE TEXT SEARCH DICTIONARY public.vietnamese (
TEMPLATE = pg_catalog.simple,
STOPWORDS = vietnamese
);
CREATE TEXT SEARCH CONFIGURATION public.vietnamese (
COPY = pg_catalog.english
);
ALTER TEXT SEARCH CONFIGURATION public.vietnamese
@505e06b2
505e06b2 / encode_webm.py
Created January 9, 2020 15:19
FFMPEG Webm Encoder - With Progress
#!/usr/bin/env python3
import subprocess, sys, multiprocessing, json, os, shlex, re
from datetime import timedelta
error_messages = {
"param_len": """Not enough parameters
Format: %s [input_file] (optional)[parameters] [movie_title]
"""
}
@quantumjim
quantumjim / Engine.py
Last active May 16, 2022 15:06
Gamified tutorial for QISKit to run on PythonAnywhere
# -*- coding: utf-8 -*-
import math
def ClearScreen () :
# DESCRIPTION:
# Prints a whole bunch of space to screen
print("\n"*200)
def ColouredString (message,colour) :
@veelenga
veelenga / chop.exs
Last active June 15, 2022 22:44
My solution for Chop guess exercise (Programming Elixir 1.3)
##############################
##Exercise: ModulesAndFunctions-6
defmodule Chop do
def guess(actual, lo..hi) when (lo <= hi) and (actual in lo..hi) do
current = guessing(lo, hi)
IO.puts "Is it #{current}"
guess(current, actual, lo..hi)
end
defp guess(value, actual, _) when value == actual, do: IO.puts value
@sunboy-2050
sunboy-2050 / gist:9543963
Last active December 26, 2021 07:59
python implement redis publish and subscribe
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# http://blog.ithomer.net
import time
import redis
import threading
class Listener(threading.Thread):
def __init__(self, r, channels):