Skip to content

Instantly share code, notes, and snippets.

@MasoudKaviani
MasoudKaviani / check_sound.py
Last active May 12, 2024 10:11
Check audio/sound exists in video, even if it has audio codec (with python)
def has_volume(file_path):
def find_volume(s):
m = re.search("(?:max_volume: )(?P<volume>.+ dB)", s, flags=re.IGNORECASE)
if not m:
return None
return m.groupdict()["volume"]
r = subprocess.run(f'ffmpeg -i "{file_path}" -filter:a volumedetect -f null /dev/null',
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT,
@amalmurali47
amalmurali47 / edit_commit_history.md
Last active May 12, 2024 10:06
Change ownership of selected older commits in Git
  1. Clone the repo.
  2. Use git rebase -i --root
  3. vim will open. Select the commits you want to modify by changing pick to edit. If you would like to change all the commits, perform the following replace: :%s/^pick/edit/g. This command changes all instances of "pick" at the start of lines to "edit".
  4. You will now be shown all the selected commits one by one. Each commit message will be displayed. You have two options:
    • If you would like to keep the commit author details the same, do a git rebase --continue.
    • If you would like to change it to a different name/email, do git commit --amend --reset-author. If --reset-author is specified, it will use the details from your git config. (If you need to specify an alternate name/email, you can do so with --author="John Doe <john@example.com>". If you would like to change the time to a previous date, you can do so with --date "2 days ago".)
  5. Do the same for all the commits and finish the rebase.
  6. Perform git push -f origin master to
@Jekins
Jekins / Markdown-docs.md
Last active May 12, 2024 10:06
Руководство по оформлению Markdown файлов

Руководство по оформлению Markdown файлов

Markdown - это облегчённый язык разметки, который преобразует текст в структурированный HTML. Следующее руководство поможет вам разобраться, как использовать Markdown.

Заголовки

# Заголовок первого уровня
## Заголовок второго уровня
### Заголовок третьего уровня
#### Заголовок четвёртого уровня
##### Заголовок пятого уровня
@eimg
eimg / minimal-react-build.md
Last active May 12, 2024 10:05
The Most Minimal React Build System

The Most Minimal React Build System

ပြီးခဲ့တဲ့ ပို့စ်မှာ React ကို ချဉ်းကပ်ပုံအသစ်နဲ့ ဖော်ပြခဲ့ပါတယ်။ ဘာ Build System မှ မပါပဲ HTML Document တစ်ခုအတွင်းမှာ တိုက်ရိုက်ရေးသားခဲ့ခြင်းဖြစ်ပါတယ်။ ဒီတစ်ခါတော့ အရိုးဆုံးနဲ့ အရှင်းဆုံး Build System တစ်ခုကို တည်ဆောက် ကြည့်ကြမှာဖြစ်ပါတယ်။ ဒီအကြောင်းအရာဟာ ကျွန်တော်ပို့ချနေတဲ့ Rockstar Developer Course မှာ ထည့်သွင်းသင်ကြားမယ့် အကြောင်းအရာ တစ်ခုပါ။ ကြိုစမ်းမထားပဲ လက်တမ်းသင်ရင် အမှားပါပြီး အချိန်ကြာမှာစိုးလို့ အခုလို ကြိုစမ်းပြီး စာအဖြစ် ကြိုရေးထားလိုက်တာပါ။ ဒီ Course မှာ တက်ရောက် သင်ယူနေသူ ဟုတ်ဟုတ် မဟုတ်ဟုတ် JavaScript နည်းပညာတွေကို စိတ်ဝင်စားသူဆိုရင် ဒီပို့စ်က အသုံးဝင်ပါလိမ့်မယ်။

စာနည်းနည်း ရှည်ပါမယ်။ အချိန်ပေးနိုင်မှ တစ်ခါတည်းဖတ်ပြီး တစ်ခါတည်းလိုက်လုပ်ကြည့်ပါ။ အချိန်မပေးနိုင်သေးရင် Bookmark လုပ်ပြီး သိမ်းထားပြီး အချိန်ရမှ ပြန်ဖတ်ပါ။ တစ်ဝက်တစ်ပျက်ပဲ ဖက်ရင်တော့ အလကားဖြစ်သွားမှာပါပဲ။ လိုက်မလုပ်ရင်လည်း အလကားပါပဲ။ သိသလိုလို မသိသလိုလို ဖြစ်သွားမယ်။ လိုက်လုပ်ကြည့်မှ တစ်ခါတည်း သဘောပေါက်မှာပါ။

Babel in Browser

လက်ရှိ ရိုးရိုး HTML ထဲမှာ ရေးထားတဲ့ နမူနာကို နောက်တစ်ခါ ပြန်

@wmeints
wmeints / ProxyProxyDance.ps1
Last active May 12, 2024 10:03
This script allows you to enable and disable your proxy settings quickly in case you work from two different locations like your home office and a workplace where they require you to use a proxy.
$internetSettings = "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings";
# Determines the current state of the proxy
function Get-ProxyState() {
$settings = Get-ItemProperty -Path $internetSettings;
return $settings.ProxyEnable;
}
# Enables the proxy.
# IMPORTANT: Change the defaults to something that is useful to you!
its ok
I set keyboard in paired mod
then in terminal:
$ bluetoothctl
[NEW] Controller 00:02:72:DE:1E:41 debi [default]
[NEW] Device 00:1F:20:EC:A5:DD Logitech Keyboard K480
[NEW] Device 00:1A:7D:55:02:06 BS-55
[NEW] Device A0:8D:16:86:81:C1 CHM-U01
[bluetooth]# connect 00:1F:20:EC:A5:DD
#######
## These results are still open to the public. See
## https://blog.ktz.me/the-best-media-server-cpu-in-the-world/
## for analysis of them.
# https://github.com/ironicbadger/quicksync_calc
# zoidberg - dell 7040 sff pc
CPU TEST FILE BITRATE TIME AVG_FPS AVG_SPEED AVG_WATTS
i5-6600T h264_1080p_cpu ribblehead_1080p_h264 18952 kb/s 116.352s 29.88 1.04x N/A
@benbacardi
benbacardi / gist:227f924ec1d9bedd242b
Last active May 12, 2024 09:55
Django reverse with a querystring
from django.utils.http import urlencode
def reverse_querystring(view, urlconf=None, args=None, kwargs=None, current_app=None, query_kwargs=None):
'''Custom reverse to handle query strings.
Usage:
reverse('app.views.my_view', kwargs={'pk': 123}, query_kwargs={'search': 'Bob'})
'''
base_url = reverse(view, urlconf=urlconf, args=args, kwargs=kwargs, current_app=current_app)
if query_kwargs:
return '{}?{}'.format(base_url, urlencode(query_kwargs))
@MarkWattTech
MarkWattTech / Camera Commands
Last active May 12, 2024 09:54
Full command
Moved Commands to GIST as YouTube is shortening some of them.
3) sudo apt install autoconf automake build-essential pkgconf libtool git libzip-dev libjpeg-dev gettext libmicrohttpd-dev libavformat-dev libavcodec-dev libavutil-dev libswscale-dev libavdevice-dev default-libmysqlclient-dev libpq-dev libsqlite3-dev libwebp-dev
4) sudo wget https://github.com/Motion-Project/motion/releases/download/release-4.3.1/pi_buster_motion_4.3.1-1_armhf.deb
Video at : https://youtu.be/QH8fRGRofv4
#EXTM3U
#EXTINF:-1,beINSports-fr1
http://iptv.am000.tv:8000/live/add17/add17/16.ts
#EXTINF:-1,beINSports-fr2
http://iptv.am000.tv:8000/live/add17/add17/17.ts
#EXTINF:-1,BEINSPORTS-FR3
http://iptv.am000.tv:8000/live/add17/add17/566.ts
#EXTINF:-1,Alkas-1
http://iptv.am000.tv:8000/live/add17/add17/73.ts
#EXTINF:-1,Alkas-2