Skip to content

Instantly share code, notes, and snippets.

View ggguser's full-sized avatar
💭
QA + python

Alexey Lagunov ggguser

💭
QA + python
View GitHub Profile
@hjwp
hjwp / test_enums.py
Created October 27, 2020 14:03
Better string enums
import random
from enum import Enum, IntEnum
class BRAIN(str, Enum):
SMALL = "small"
MEDIUM = "medium"
GALAXY = "galaxy"
def __str__(self) -> str:
@MineRobber9000
MineRobber9000 / donotuse3.py
Last active February 8, 2024 12:48
How to NEVER use lambdas - Python 3 edition
###########################################################
# How to NEVER use lambdas. An inneficient and yet educa- #
# tonal [sic] guide to the proper misuse of the lambda #
# construct in Python 3.x. [DO NOT USE ANY OF THIS EVER] #
# original by (and apologies to): e000 (13/6/11) #
# now in Python 3 courtesy of: khuxkm (17/9/20) #
###########################################################
## Part 1. Basic LAMBDA Introduction ##
# If you're reading this, you've probably already read e000's
@loganasherjones
loganasherjones / agnoster-pyenv
Created February 5, 2019 02:39
Display pyenv environment on agnoster prompt
# vim:ft=zsh ts=2 sw=2 sts=2
#
# agnoster's Theme - https://gist.github.com/3712874
# A Powerline-inspired theme for ZSH
#
# # README
#
# In order for this theme to render correctly, you will need a
# [Powerline-patched font](https://github.com/Lokaltog/powerline-fonts).
# Make sure you have a recent version: the code points that Powerline
@aMoRRoMa
aMoRRoMa / interview
Last active September 28, 2023 10:41
Tasks for interview of programmer(Javascript)
// 1. You need to implement function that return array of powers for the number (10min)
const getPowersOfNumber = (number, until) => {
return 'not implemented';
};
// test
const answer = [1, 3, 9, 27];
console.log(
@ZwaarContrast
ZwaarContrast / Dropzone.js
Last active May 2, 2023 20:31
Using cypress with react-dropzone to upload a file.
// your react component
import * as React from 'react'
import Dropzone from 'react-dropzone'
// apply your own styling and stuff, should probably also show the files when uploaded
const Upload = () => {
return (<Dropzone data-cy="drag-and-drop">Drag and Drop here</Dropzone>)
}
export default Upload
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@greyli
greyli / app.py
Last active February 25, 2024 03:04
Photo upload and manage with Flask and Flask-Uploads (Multiple file upload support!).
# -*- coding: utf-8 -*-
import os
import uuid
from flask import Flask, render_template, redirect, url_for, request
from flask_uploads import UploadSet, configure_uploads, IMAGES, patch_request_class
from flask_wtf import FlaskForm
from flask_wtf.file import FileField, FileRequired, FileAllowed
from wtforms import SubmitField
@ghaiklor
ghaiklor / iterm-fish-fisherman-meslo-osx.md
Last active December 5, 2022 11:14
iTerm 2 + fish + fisherman + Material Design + Meslo
@snakeye
snakeye / exif_gps.py
Last active October 10, 2023 09:44
Python: get GPS latitude and longitude coordinates from JPEG EXIF using exifread
import exifread
# based on https://gist.github.com/erans/983821
def _get_if_exist(data, key):
if key in data:
return data[key]
return None
@kwmiebach
kwmiebach / pytest.md
Last active June 4, 2024 06:29 — forked from amatellanes/pytest.sh
pytest cheat sheet

Usage

(Create a symlink pytest for py.test)

pytest [options] [file_or_dir] [file_or_dir] ...

Help: