Skip to content

Instantly share code, notes, and snippets.

View dennislwm's full-sized avatar

Dennis Lee dennislwm

View GitHub Profile
@dennislwm
dennislwm / display-latest-pipelines.py
Created July 6, 2024 09:30
GitLab: A Python Script Displaying Latest Pipelines in a Group's Projects
#
# Display, in console, latest pipelines from each project in a given group
#
# python display-latest-pipelines.py --group-id=8784450 [--watch] [--token=$GITLAB_TOKEN] [--host=gitlab.com] [--exclude='TPs Benoit C,whatever'] [--stages-width=30]
#
import argparse
from datetime import datetime
from enum import Enum
import os
import pytz
@dennislwm
dennislwm / vtt2text.py
Created January 19, 2024 02:55 — forked from glasslion/vtt2text.py
This script convert youtube subtitle file(vtt) to plain text.
"""
Convert YouTube subtitles(vtt) to human readable text.
Download only subtitles from YouTube with youtube-dl:
youtube-dl --skip-download --convert-subs vtt <video_url>
Note that default subtitle format provided by YouTube is ass, which is hard
to process with simple regex. Luckily youtube-dl can convert ass to vtt, which
is easier to process.
Other 1 hr 2 mins ███████████████████▊░ 94.5%
JSON 3 mins █▏░░░░░░░░░░░░░░░░░░░ 5.5%
@dennislwm
dennislwm / 26.01.2022
Created January 27, 2022 05:41
Apocryphal Gospel
Prayer from Pope Francis 26.01.2022
Saint Joseph, you are the man who dreams,
teach us to recover the spiritual life
as the inner place where God manifests Himself and saves us.
Remove from us the thought that praying is useless;
help each one of us to correspond to what the Lord shows us.
May our reasoning be illuminated by the light of the Spirit,
our hearts encouraged by His strength
and our fears saved by His mercy. Amen.
@dennislwm
dennislwm / bracket.py
Last active January 22, 2022 07:41
singtel interview coding test find saddle point matrix.py
import sys
for line in sys.stdin:
numOpen = 0
numLength = 0
for c in line:
if c == '(':
numOpen += 1
elif c == ')':
numOpen -= 1
if numOpen < 0:
#!/usr/bin/env python
import math
import sys
from moviepy.editor import AudioClip, VideoFileClip, concatenate_videoclips
# Get average RGB of part of a frame. Frame is H * W * 3 (rgb)
# Assumes x1 < x2, y1 < y2
@dennislwm
dennislwm / Why upgrade to Happi Cookie?
Last active September 9, 2020 02:49
Happi Cookie
@dennislwm
dennislwm / 1. Suggested template
Last active December 14, 2019 08:28
Specs for Github Commits
Template:
Summarize the change in less than 50 characters
Because:
- Explain the reasons you made this change
- Make a new bullet for each reason
- Each line should be under 72 characters
Explain exactly what was done in this commit with more depth than the
@dennislwm
dennislwm / Cumulant Ratio Indicator in Metatrader 4 (MT4).md
Last active April 2, 2021 21:05
FX-Git Indicators in Metatrader 4 (MT4)

A Non-Lag Indicator using Digital Signal Processing in Metatrader 4 ["MT4"]

Introduction

What the heck is Digital Signal Processing ["DSP"]?

For those not familiar with DSP, it is an engineering tool used to filter noise from signal and it has many practical uses in different industries.

In 2011, when I started trading in the forex market, I purchased several books including a trading book, titled Cybernetic Analysis for Stocks and Futures by John F. Ehlers. This was my first encounter of DSP in trading.

@dennislwm
dennislwm / Master-Slave.md
Last active January 27, 2020 05:23
MT4-Telegram-Bot-Recon

Prerequisite

  • MT4 Demo Account

Challenge

Create a function that returns a chain of history and partial orders from a single ticket number