Skip to content

Instantly share code, notes, and snippets.

View pure-rgb's full-sized avatar
💭
I may be slow to respond.

simon pure-rgb

💭
I may be slow to respond.
View GitHub Profile
@innat
innat / FFmpeg | Basic Operation on Subtitles.md
Last active June 6, 2025 06:18
Remove hard subtitles from video file || Integrate subtitles into a video file || Generate .srt file from a video file.

Download FFmpeg for Windows

Steps

  • Download FFmpeg
  • Extract it and save it to C drive ( choose any location - it's optional )
  • Set environment variable - copy the location of bin folder which is inside the extracted file and set the location on system path variable.
  • Done!
@innat
innat / OpenCV_3_Python_3x.md
Last active November 24, 2018 15:53
Installing OpenCV3 for Python3x

Supported Python versions

Python 2.7 is the only supported version in 2.x series. Python 3.x releases follow Numpy releases. For example Python 3.3 is no longer supported by Numpy so support for it has been dropped in opencv-python, too.

Currently, builds for following Python versions are provided:

  • 2.7
  • 3.4
  • 3.5
@innat
innat / Notebook Image Inclusion.md
Last active November 24, 2018 15:52
Include image or picture in jupyter notebook.

Problem Space

How to Include image or picture in jupyter notebook?

Method 1: Markdown Cell

Run like following on markdown cell,

![title]()

Some GitHub Extensions that I use. They may also enable you to improve your productivity on GitHub.

  1. Octotree allows easy exploration of the source code within the browser through a panel on the left.

chrome-github

2 github-dashboard provides the ability to filter events on the Github.com activity dashboard.

i

@innat
innat / NumPad.md
Last active November 24, 2018 15:51
Explaining Padding using NumPy

NumPy 1.7 (when np.pad was added) is pretty old now (it was released in 2013) so even though the question asked for a way without that function I thought it could be useful to know how that could be achieved using np.pad.

It's actually pretty simple:

>>> import numpy as np
>>> a = np.array([[ 1.,  1.,  1.,  1.,  1.],
...               [ 1.,  1.,  1.,  1.,  1.],
...               [ 1.,  1.,  1.,  1.,  1.]])
>>> np.pad(a, [(0, 1), (0, 1)], mode='constant')

array([[ 1., 1., 1., 1., 1., 0.],

@innat
innat / Delete Key.md
Last active November 24, 2018 15:51
Removing Key from Python Dictionary.

We can delete a key from a Python dictionary by the some following approaches.

Using the del keyword; it's almost the same approach like you did though -

     myDict = {'one': 100, 'two': 200, 'three': 300 }
     print(myDict)  # {'one': 100, 'two': 200, 'three': 300}
     if myDict.get('one') : del myDict['one']
     print(myDict)  # {'two': 200, 'three': 300}
@innat
innat / ImageCenter.md
Created November 11, 2018 23:05
Center Images in GitHub README.md

For left alignment

 <img align="left" width="600" height="200" src="https://www.python.org/python-.png">

For right alignment

<img align="right" width="600" height="200" src="https://www.python.org/python-.png">

And for center alignment

@innat
innat / FilterMap.md
Last active November 24, 2018 15:50
Python: Difference between filter(function, sequence) and map(function, sequence)

map and filter function in python is pretty different because they perform very differently. Let's have a quick example to differentiate them.

map function

Let's define a function which will take a string argument and check whether it presents in vowel letter sequences.

def lit(word):
    return word in 'aeiou'

Now let's create a map function for this and pass some random string.

@innat
innat / DotMultiply.md
Last active September 6, 2024 21:38
In Python np.dot and np.multiply with np.sum