Skip to content

Instantly share code, notes, and snippets.

View ksindi's full-sized avatar
🚀
Shipping

Kamil Sindi ksindi

🚀
Shipping
View GitHub Profile
@ksindi
ksindi / git_size.sh
Last active February 23, 2024 15:12
Versioned files in human readable format sorted by size
git ls-tree -rz --name-only HEAD -- | xargs -0 du -kh | sort -sh -k 1,1
@ksindi
ksindi / imagemagick-install-steps
Created July 16, 2017 03:36 — forked from rodleviton/imagemagick-install-steps
Installing Image Magick on Ubuntu 14.04
sudo -i
cd
apt-get install build-essential checkinstall && apt-get build-dep imagemagick -y
wget http://www.imagemagick.org/download/ImageMagick-6.8.7-7.tar.gz
tar xzvf ImageMagick-6.8.9-1.tar.gz
cd ImageMagick-6.8.9-1/
./configure --prefix=/opt/imagemagick-6.8 && make
checkinstall
@ksindi
ksindi / pypdf_to_image.py
Created July 15, 2017 16:05 — forked from rririanto/pypdf_to_image.py
Python Convert PDF to Image
"""
Problem:
How to Convert PDF to Image with Python Script ?
Installation:
I use ubuntu OS 14.04
We use wrapper for ImageMagick [http://www.imagemagick.org/script/index.php] to Convert The PDF file
in Python do:
$ sudo apt-get install libmagickwand-dev
@ksindi
ksindi / pdfmod.py
Created July 15, 2017 13:51 — forked from jrsmith3/pdfmod.py
Convert specified pages from a PDF to png
"""
This script was used to create the figures for http://jrsmith3.github.io/sample-logs-the-secret-to-managing-multi-person-projects.html from a PDF file containing some old CMU sample logs.
"""
import PyPDF2
from wand.image import Image
import io
import os
import asyncio
async def bar(i):
print('started', i)
await asyncio.sleep(1)
print('finished', i)
if i == 5:
raise ValueError("Foo")
return i
@ksindi
ksindi / conftest.py
Created April 28, 2017 02:49 — forked from billyshambrook/conftest.py
Categorise integration tests using PyTest.
import pytest
def pytest_addoption(parser):
parser.addoption("--integration", action="store_true", help="run integration tests")
def pytest_runtest_setup(item):
if 'integration' in item.keywords:
if not item.config.getoption("--integration"):
@ksindi
ksindi / promises.md
Created April 14, 2017 16:00 — forked from domenic/promises.md
You're Missing the Point of Promises

This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.

You're Missing the Point of Promises

Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:

getTweetsFor("domenic", function (err, results) {
 // the rest of your code goes here.
delcheck() {
to_del=$1
read -p "Delete ${to_del}? [y/N] " doit
case "$doit" in
[yY]) rm -rf "$to_del";;
*) printf 'No files deleted\nExiting...\n'; exit 1;
esac
}
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Train model using transfer learning on InceptionV3."""
from keras.applications.inception_v3 import InceptionV3
from keras.preprocessing.image import ImageDataGenerator
from keras.models import Model
from keras.layers import Dense, GlobalAveragePooling2D
CLASSES = "daisy dandelion roses sunflowers tulips".split()
@ksindi
ksindi / serialize_pool3_tensorflow.py
Created April 1, 2017 16:41 — forked from sthomp/serialize_pool3_tensorflow.py
Serializing pool_3 weights in TensorFlow
def load_pool3_data():
X_test_file = 'X_test_20160212-00:06:14.npy'
y_test_file = 'y_test_20160212-00:06:14.npy'
X_train_file = 'X_train_20160212-00:06:14.npy'
y_train_file = 'y_train_20160212-00:06:14.npy'
return np.load(X_train_file), np.load(y_train_file), np.load(X_test_file), np.load(y_test_file)
def batch_pool3_features(sess,X_input):
"""