This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gi | |
gi.require_version('Gst', '1.0') | |
from gi.repository import GObject, Gst | |
from threading import Thread, Event | |
GObject.threads_init() | |
Gst.init(None) | |
class Main: | |
def __init__(self): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, subprocess | |
# Remove null characters. | |
# http://gnuwin32.sourceforge.net/packages/coreutils.htm | |
file = "your_file_here" | |
command = ["C:\\Program Files (x86)\\GnuWin32\\bin\\tr.exe", | |
"-d \'\\000\'"] | |
with open(file, "r") as original, open(file + ".new", "w", encoding="utf-8") as modified: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, subprocess | |
# Convert from ANSI (Windows-1251) to UTF-8 using iconv. | |
# http://gnuwin32.sourceforge.net/packages/libiconv.htm | |
file = "your_file_here" | |
command = ["C:\\Program Files (x86)\\GnuWin32\\bin\\iconv.exe", | |
"-f cp1251", # Could also be cp1252 or other encoding types. | |
"-t utf-8", | |
'"' + file + '"'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT b1.bID as id, | |
u.uID as post_author, | |
b1.bDateAdded as post_date, | |
CONVERT_TZ(b1.bDateAdded,'-05:00','+00:00') as post_date_gmt, | |
b2.content as post_content, | |
c2.cvName as post_title, | |
c2.cvDescription as post_excerpt, | |
IF(b1.bIsActive = 1,'publish','draft') as post_status, | |
'open' as comment_status, | |
'open' as ping_status, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Backup MySQL database using dotenv file | |
# | |
# Example: | |
# ./backup_database.sh /path_to_project/.env | |
# | |
# Result: | |
# Schema-only and data-only .sql files |
NewerOlder