Skip to content

Instantly share code, notes, and snippets.

View zstarpak's full-sized avatar
🏠
Working from home

Ali Raza zstarpak

🏠
Working from home
View GitHub Profile
@zstarpak
zstarpak / README.md
Created September 30, 2021 02:25 — forked from arashpath/README.md
Mi Cloud Batch Download Recordings and Gallery
@zstarpak
zstarpak / gitignore_already_tracked_file.md
Created December 14, 2020 09:33 — forked from tsrivishnu/gitignore_already_tracked_file.md
Git: Ignore already checked in file

Git: How can I ignore a file that is already committed to the repo?

You have a repo and quite some developers have cloned the repo and working on it. Now you want to add a file to gitignore which is already checked-in or tracked by Git.(The file is already commited into the repo)

Below are the steps on how to ignore this file (lets say the filename is config.py):

  • Add it to .gitignore:

$ echo "config.py" >> .gitignore

@zstarpak
zstarpak / !NOTE.md
Created December 14, 2020 08:38 — forked from mehranhadidi/!NOTE.md
Setup a Laravel Storage driver with Google Drive API
@zstarpak
zstarpak / xml_split.py
Created November 22, 2020 08:29 — forked from benallard/xml_split.py
Small python script to split huge XML files into parts. It takes one or two parameters. The first is always the huge XML file, and the second the size of the wished chunks in Kb (default to 1Mb) (0 spilt wherever possible) The generated files are called like the original one with an index between the filename and the extension like that: bigxml.…
#!/usr/bin/env python
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
# How much data we process at a time
@zstarpak
zstarpak / xml_split.py
Created November 22, 2020 08:29 — forked from scnctech/xml_split.py
I took this gist https://gist.github.com/benallard/8042835 and modified it a little so it worked for my needs. (mainly encoding issues and bigger file chunks)
#!/usr/bin/env python
#based off this gist https://gist.github.com/benallard/8042835
#modified it a little so it worked for my needs. (mainly encoding issues and bigger file chunks)
import os
import xml.parsers.expat
from xml.sax.saxutils import escape
from optparse import OptionParser
from math import log10
@zstarpak
zstarpak / XML_breaker.py
Created November 22, 2020 08:29 — forked from nicwolff/XML_breaker.py
Python script to break large XML files
import os
import sys
from xml.sax import parse
from xml.sax.saxutils import XMLGenerator
class CycleFile(object):
def __init__(self, filename):
self.basename, self.ext = os.path.splitext(filename)
self.index = 0
@zstarpak
zstarpak / boxplot.html
Created March 28, 2020 05:54
Basic Boxplot with D3.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>BoxPlot</title>
<script src="https://d3js.org/d3.v4.js"></script>
</head>
<body>
<h3>Basic BoxPlot With D3.js</h3>
<div id="my_dataviz"></div>
@zstarpak
zstarpak / unzip.php
Created June 26, 2019 13:49 — forked from trajche/unzip.php
Unzip a file on one.com with PHP
<?php
$unzip = new ZipArchive;
$out = $unzip->open('file-name.zip');
if ($out === TRUE) {
$unzip->extractTo(getcwd());
$unzip->close();
echo 'File unzipped';
} else {
echo 'Something went wrong?';