Skip to content

Instantly share code, notes, and snippets.

@databill86
databill86 / gist:d0dcea6799f63f3274831df54919ff92
Created February 3, 2021 13:09 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@databill86
databill86 / py.md
Created November 1, 2020 09:21 — forked from jph00/py.md
Organized and hyperlinked index to every module, function, and class in the Python standard library

All of the python 3.9 standard library

For a version without the collapsible details sections (so you can search the whole thing in your browser), click here.

@databill86
databill86 / loading_wikipedia.py
Created June 15, 2020 13:35 — forked from thomwolf/loading_wikipedia.py
Load full English Wikipedia dataset in HuggingFace nlp library
import os; import psutil; import timeit
from nlp import load_dataset
mem_before = psutil.Process(os.getpid()).memory_info().rss >> 20
wiki = load_dataset("wikipedia", "20200501.en", split='train')
mem_after = psutil.Process(os.getpid()).memory_info().rss >> 20
print(f"RAM memory used: {(mem_after - mem_before)} MB")
s = """batch_size = 1000
for i in range(0, len(wiki), batch_size):
@databill86
databill86 / bobp-python.md
Created May 6, 2020 18:03 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens

Following on from a meeting with Simon, Ed, and Bryan. It seems like we’re trying to answer two questions:

  • Where are we overloaded?
  • What aren't we using? (That we should look to find or fit work to.)

Different contexts:

  • Managing current load
  • Always starts with released shop orders.
@databill86
databill86 / streamlit_prodigy.py
Created March 30, 2020 07:57 — forked from ines/streamlit_prodigy.py
Streamlit + Prodigy
"""
Example of a Streamlit app for an interactive Prodigy dataset viewer that also lets you
run simple training experiments for NER and text classification.
Requires the Prodigy annotation tool to be installed: https://prodi.gy
See here for details on Streamlit: https://streamlit.io.
"""
import streamlit as st
from prodigy.components.db import connect
from prodigy.models.ner import EntityRecognizer, merge_spans, guess_batch_size
"""
Générateur de jours ouvrés français en python
"""
def easter_date(year):
"""
Calcule la date du jour de Pâques d'une année donnée
Voir https://github.com/dateutil/dateutil/blob/master/dateutil/easter.py
:return: datetime
@databill86
databill86 / nginx-tuning.md
Created September 24, 2019 14:12 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@databill86
databill86 / capp_treemaps.py
Created August 1, 2019 07:11 — forked from gVallverdu/capp_treemaps.py
Treemaps with python and matplotlib
import matplotlib
import matplotlib.pyplot as plt
import pandas as pd
import squarify
# qualtities plotted
# squarre area is the town surface area (superf)
# color scale is the town population in 2011 (p11_pop)
# read data from csv file