Skip to content

Instantly share code, notes, and snippets.

View arash16's full-sized avatar
💭
Coding..

Arash Shakery arash16

💭
Coding..
View GitHub Profile
@shubhamagarwal92
shubhamagarwal92 / get_bert_embeddings.py
Created July 22, 2019 21:49
Use pytorch-transformers from hugging face to get bert embeddings in pytorch
import torch
import logging
from pytorch_transformers import BertModel, BertTokenizer
from pytorch_transformers import *
from typing import List
CLS_TOKEN = "[CLS]"
SEP_TOKEN = "[SEP]"
logger = logging.getLogger(__name__)
@sn3p
sn3p / favicon.js
Created February 8, 2017 17:24
Dynamic favicon with count badge
// Usage:
// <link rel="shortcut icon" href="favicon.png" data-count"5">
(() => {
const faviconSize = 32;
const favicon = document.querySelector('[data-count]')
// No notifications
if (!favicon || !favicon.dataset.count) {
return;
@ssskip
ssskip / ISO3166-1.alpha2.json
Last active July 25, 2024 11:54
json of country codes (ISO 3166-1 alpha-2) and corresponding names
{
"AF": "Afghanistan",
"AX": "Aland Islands",
"AL": "Albania",
"DZ": "Algeria",
"AS": "American Samoa",
"AD": "Andorra",
"AO": "Angola",
"AI": "Anguilla",
"AQ": "Antarctica",
CREATE TEXT SEARCH CONFIGURATION fr ( COPY = french );
ALTER TEXT SEARCH CONFIGURATION fr ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, french_stem;
CREATE TEXT SEARCH CONFIGURATION en ( COPY = english );
ALTER TEXT SEARCH CONFIGURATION en ALTER MAPPING
FOR hword, hword_part, word WITH unaccent, english_stem;
CREATE TEXT SEARCH CONFIGURATION de ( COPY = german );
ALTER TEXT SEARCH CONFIGURATION de ALTER MAPPING