Skip to content

Instantly share code, notes, and snippets.

View khanfarhan10's full-sized avatar
🎯
Focusing

Farhan Hai Khan khanfarhan10

🎯
Focusing
View GitHub Profile
@ngrislain
ngrislain / py38-success.ipynb
Last active May 3, 2024 02:13
py38 success.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
from PyPDF2 import PdfFileWriter, PdfFileReader
# https://stackoverflow.com/questions/490195/split-a-multi-page-pdf-file-into-multiple-pdf-files-with-python#490203
def pdf_split(fname, start, end=None):
print('pdf_split', fname, start, end)
# pdf_split ~/Downloads/4-27-files/Invoice Email-0.pdf 1 4
#inputpdf = PdfFileReader(open("document.pdf", "rb"))
inputpdf = PdfFileReader(open(fname, "rb"))
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tuffacton
tuffacton / streamlit_colab.ipynb
Last active March 7, 2024 05:47
Colaboratory Notebook that hosts a streamlit app and creates an ngrok https tunnel for access.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Quacky2200
Quacky2200 / repermute.py
Last active February 13, 2024 18:31 — forked from mdeous/repermute.py
Generate all possible permutations of a regex (Python v3)
# -*- coding: utf-8 -*-
#
# Used like this:
#
# from repermute import ipermute
#
# for s in ipermute('[A-Z]\d'):
# print s
#
# Almost all regular expression constructs are supported except for '*'
%%%%%%%%%%%%%%%%%
% This is an example CV created using altacv.cls (v1.1.3, 30 April 2017) written by
% LianTze Lim (liantze@gmail.com), based on the
% Cv created by BusinessInsider at http://www.businessinsider.my/a-sample-resume-for-marissa-mayer-2016-7/?r=US&IR=T
%
%% It may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3
%% of this license or (at your option) any later version.
%% The latest version of this license is in
%% http://www.latex-project.org/lppl.txt
@Pulimet
Pulimet / AdbCommands
Last active July 20, 2024 12:55
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@nmische
nmische / trans_problem_1.py
Created November 5, 2013 15:08
Gurobi solution for the first transportation problem in An Illustrated Guide to Linear Programming.
from gurobipy import *
try:
factories = ['FactoryOne','FactoryTwo']
stores = ['StoreOne','StoreTwo','StoreThree']
cost = {
('FactoryOne','StoreOne'): 8,
@thbar
thbar / how-to-diff-pdf-files-with-git-and-diffpdf.md
Last active June 30, 2024 10:38
How to diff PDF files with Git

One can use MD5 or plain text diff to see differences in PDF files. If that's not enough, here's how to use diff-pdf which knows how to diff based on appearance or words:

  • brew install diff-pdf
  • edit your ~/.gitconfig to add this:
[difftool "diffpdf"]
  cmd = diff-pdf --view \"$LOCAL\" \"$REMOTE\"
@BigglesZX
BigglesZX / gifextract.py
Created November 5, 2012 10:31
Extract frames from an animated GIF, correctly handling palettes and frame update modes
import os
from PIL import Image
'''
I searched high and low for solutions to the "extract animated GIF frames in Python"
problem, and after much trial and error came up with the following solution based
on several partial examples around the web (mostly Stack Overflow).
There are two pitfalls that aren't often mentioned when dealing with animated GIFs -