Skip to content

Instantly share code, notes, and snippets.

@gante
gante / generate_benchmark.py
Last active December 19, 2022 16:39
Benchmark Hugging Face generation for PT, FLAX, TF with Eager Execution, and TF with XLA.
import os
import time
from datetime import timedelta
from functools import wraps, partial
from tqdm import tqdm
# JAX imports and settings
os.environ["XLA_PYTHON_CLIENT_PREALLOCATE"] = "false"
import jax
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@johnpaulashenfelter
johnpaulashenfelter / Unicode table
Created August 29, 2016 16:46 — forked from ivandrofly/Unicode table
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:
@kibotu
kibotu / FeedbackFragment.java
Created August 5, 2015 18:21
mandrill send message
private void sendMessage(@NotNull final String fromEmail, @NotNull final String fromName) {
final String apiKey = AppConfig.getValue(MANDRILLAPP_API_KEY);
final MandrillServiceFactory serviceFactory = new MandrillServiceFactory(apiKey, new GsonJsonHandler(new Gson()), new HttpComponentsHandler(new DefaultHttpClient()));
final Category.Messages messages = serviceFactory.getService(Category.Messages.class);
final Struct message = Struct.with("text", "" + feedbackMessage.getText().toString())
.set("to", StructArray.with(Struct.with("email", Localization.getString(R.string.kEmailTitle))))
.set("subject", Localization.getString(currentMode.resourceId))
.set("from_email", fromEmail)
.set("from_name", fromName);
@PiiXiieeS
PiiXiieeS / Insert a progress bar to Powerpoint presentation .md
Last active January 17, 2024 13:12
Insert a progress bar to Powerpoint presentation

Intro

To view the progress of a Powerpoint presentation, a progress bar can be displayed at the bottom of the slide show.

How to proceed

Once the slideshow is complete, go to Tools > Macro > Visual Basic Editor.

In the new window, select Insert > Module and copy this text in the blank page:

Sub AddProgressBar()
    On Error Resume Next