Skip to content

Instantly share code, notes, and snippets.

View alisatl's full-sized avatar

Alisa Zhila alisatl

View GitHub Profile
@RhetTbull
RhetTbull / vision.py
Last active October 29, 2024 19:59
Use Apple's Vision framework from Python to detect text in images
""" Use Apple's Vision Framework via PyObjC to detect text in images
To use:
python3 -m pip install pyobjc-core pyobjc-framework-Quartz pyobjc-framework-Vision wurlitzer
"""
import pathlib

Docker в продакшене.

С интересом ознакомился на днях с негативным опытом использования Docker в продакшене. Несмотря на то, что автор позиционирует себя, как матерого разработчика и девопса, легко отвечающего на вопросы типа "сколько шариков для пинг-понга могут взвесить в Сан-Франциско настройщики фортепиано, если шарики нельзя помечать", он не провел предварительного исследования, а спроектировав решение, сумел наткнуться на все известные минусы Docker. Видно, что его ограниченность одной убунчей, на которую он лазит по ssh со своего макбука, серьезно мешает ему в работе.

Укажу на то, что резануло глаз сразу.

"My first encounter with docker goes back to early 2015. Docker was experimented with to find out whether it could benefit us. At the time it wasn’t possible to run a container [i

@metatoaster
metatoaster / test_stdio.py
Last active September 19, 2021 13:39
Simple Python unittest for mocking/stubbing sys.stdin and friends using native libs.
# -*- coding: utf-8 -*-
# To use, at the directory you saved this:
# python -m unittest test_stdio
import sys
import io
import unittest
def stub_stdin(testcase_inst, inputs):
@imalsogreg
imalsogreg / Makefile.config
Created February 19, 2016 20:00
my caffe makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
@baraldilorenzo
baraldilorenzo / readme.md
Last active October 10, 2024 23:19
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman

@karpathy
karpathy / min-char-rnn.py
Last active November 4, 2024 09:06
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
from keras.models import Sequential
from keras.layers.core import Dense, Dropout, Activation, Flatten
from keras.layers.convolutional import Convolution2D, MaxPooling2D
from keras.layers.normalization import BatchNormalization
#AlexNet with batch normalization in Keras
#input image is 224x224
model = Sequential()
model.add(Convolution2D(64, 3, 11, 11, border_mode='full'))
@staltz
staltz / introrx.md
Last active November 4, 2024 10:23
The introduction to Reactive Programming you've been missing
@n00neimp0rtant
n00neimp0rtant / gist:9515611
Last active September 5, 2024 09:24
simple squash without rebase
## within current branch, squashes all commits that are ahead of master down into one
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case)
## commit any working changes on branch "mybranchname", then...
git checkout master
git checkout -b mybranchname_temp
git merge --squash mybranchname
git commit -am "Message describing all squashed commits"
git branch -m mybranchname mybranchname_unsquashed
git branch -m mybranchname
@davfre
davfre / git_cheat-sheet.md
Last active August 11, 2024 11:12
git commandline cheat-sheet