Skip to content

Instantly share code, notes, and snippets.

View kazemihabib's full-sized avatar

Habib Kazemi kazemihabib

View GitHub Profile
@kazemihabib
kazemihabib / .gitignore
Created March 10, 2017 17:14
xilinxise .gitignore
# Created by https://www.gitignore.io/api/xilinxise
### XilinxISE ###
# intermediate build files
*.bgn
*.bit
*.bld
*.cmd_log
*.drc
@kazemihabib
kazemihabib / PatternEditableBuilder.java
Created April 16, 2017 22:53 — forked from nesquena/PatternEditableBuilder.java
PatternEditableBuilder - Easy way to create colored clickable spans within a TextView!
import android.text.SpannableStringBuilder;
import android.text.Spanned;
import android.text.TextPaint;
import android.text.method.LinkMovementMethod;
import android.text.style.ClickableSpan;
import android.view.View;
import android.widget.TextView;
import java.util.ArrayList;
import java.util.regex.Matcher;
@kazemihabib
kazemihabib / subExtractor.py
Created June 17, 2017 18:02
Extract srt file from mkv movies with ffmpeg
import os
from os.path import splitext
listOfFiles = os.listdir()
for name in listOfFiles:
file_name,extension = splitext(name)
if(extension != ".mkv"):
continue
os.system("ffmpeg -i " + name + " -an -vn -c:s:1 srt "+ file_name+".srt")
@kazemihabib
kazemihabib / gist:e5e0b2f5e31d0e7b78f59f53be343f1f
Created July 3, 2017 20:57
Split pdf per chapter with output with chapter name
source : http://www.tianxiangxiong.com/2016/02/05/split-pdf-file-by-bookmarks.html
My custimized version:
sejda-console splitbybookmarks -f <input-pdf> -o <output-folder> -l 1 -p "[BOOKMARK_NAME]"
# How to use flake8 as linter:
pip install flake8
"ctrl + shift + p" then "select linter"
@kazemihabib
kazemihabib / Using Git to Manage a Live Web Site.md
Last active January 6, 2019 12:42 — forked from Nilpo/Using Git to Manage a Live Web Site.md
Using Git to Manage a Live Web Site

Using Git to Manage a Live Web Site

Overview

As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.

Contents

@kazemihabib
kazemihabib / gist:0b983c92fcc785988ea651bdb3b152fd
Created May 21, 2018 18:11
How to create Transparent window in pyGtk
https://stackoverflow.com/a/33294727/4146943
https://stackoverflow.com/a/19800058/4146943

Show all unread messages: in:inbox is:unread

@kazemihabib
kazemihabib / gist:b8e02c19916aae325a9d3a21d193324b
Created December 25, 2018 06:32
How to fix Gpu has fallen off the bus when waking up from suspend
sudo vim /etc/default/grub
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash rcutree.rcu_idle_gp_delay=1 acpi_osi=! acpi_osi='Windows 2009'"
sudo update-grub
@kazemihabib
kazemihabib / Install_ldoce5viewer_ubuntu_19.04.txt
Created December 13, 2019 11:57
Install ldoce5viewer ubuntu 19.04
Follow https://askubuntu.com/a/1066810 to install qt5 version.
To fix the sound problem follow
# apt install pyqt5-dev-tools gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly python3-pyqt5.qtmultimedia python3-pyqt5.qtwebkit libqt5multimedia5-plugins
and:
# pip3 install whoosh==2.5.7
(copied from https://github.com/ciscorn/ldoce5viewer/issues/47#issuecomment-478391492)