Skip to content

Instantly share code, notes, and snippets.

View denis-trofimov's full-sized avatar

Denis Trofimov denis-trofimov

View GitHub Profile
@bradtraversy
bradtraversy / pipenv_cheat_sheet.md
Last active July 7, 2024 20:34
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
@cnu
cnu / download.go
Created December 2, 2018 19:23
Download files in Go
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
@gilrosenthal
gilrosenthal / Fast.ai install script
Created July 4, 2018 20:14
Fast.ai Install on Google Colab
!pip install fastai
!apt-get -qq install -y libsm6 libxext6 && pip install -q -U opencv-python
import cv2
from os import path
from wheel.pep425tags import get_abbr_impl, get_impl_ver, get_abi_tag
platform = '{}{}-{}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag())
accelerator = 'cu80' if path.exists('/opt/bin/nvidia-smi') else 'cpu'
!pip install -q http://download.pytorch.org/whl/{accelerator}/torch-0.3.0.post4-{platform}-linux_x86_64.whl torchvision
@mauri870
mauri870 / tf-serving-client.go
Last active April 2, 2022 08:43
Tensorflow Serving Go client for the inception model
// Tensorflow Serving Go client for the inception model
// go get github.com/golang/protobuf/ptypes/wrappers google.golang.org/grpc
//
// Compile the proto files:
//
// git clone https://github.com/tensorflow/serving.git
// git clone https://github.com/tensorflow/tensorflow.git
//
// mkdir -p vendor
@inancgumus
inancgumus / exercise_18_slices_pic_show.go
Last active August 23, 2023 10:58
go tour exercise solutions
package main
import "golang.org/x/tour/pic"
func Pic(dx, dy int) [][]uint8 {
p := make([][]uint8, dy)
for y := range p {
p[y] = make([]uint8, dx)
for x := 0; x < dx; x++ {
p[y][x] = uint8(x^y)
@physacco
physacco / README.md
Last active December 27, 2023 09:05
Python 3 extension example

Python 3 extension example

Build

python3 setup.py build

Output: build/lib.macosx-10.11-x86_64-3.5/hello.cpython-35m-darwin.so

Run

@reallistic
reallistic / locustfile.py
Created June 12, 2016 22:31
Websocket client for locust.io (SockJS)
import time
import json
import gevent
from uuid import uuid4
from locust import HttpLocust, TaskSet, task, ResponseError, events, Locust
import websocket
class SocketClient(object):
@crodjer
crodjer / test_ws.py
Created August 22, 2015 12:50
Application to demonstrate testing tornado websockets
'''
Application to demonstrate testing tornado websockets.
Try it wiith: python -m tornado.testing discover
'''
from tornado import testing, httpserver, gen, websocket
from ws import APP
@yamionp
yamionp / locustfile.py
Last active March 21, 2024 22:56
Websocket Locust Sample. locustfile and Echo/Chat Server
# -*- coding:utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import json
import uuid
import time
import gevent