Skip to content

Instantly share code, notes, and snippets.

@remram44
remram44 / fasttextpickle.py
Created September 21, 2021 17:58
FastText Pickle Wrapper
from fastText import load_model
import tempfile
class PickleableFastText(object):
def __init__(self, model):
self._wrapped_model = model
def __getattr__(self, key):
return getattr(self._wrapped_model, key)
@remram44
remram44 / userscript.js
Last active February 19, 2023 04:44
Embed HTML in Google Slides
// ==UserScript==
// @name Google Slides embedder
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Shows an iframe in Google Slides presentation to fake embedding
// @author Remi Rampin
// @match https://docs.google.com/presentation/d/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// ==/UserScript==
@remram44
remram44 / non_d3m_datasets.ipynb
Last active February 24, 2021 21:41
Windows test 4
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@remram44
remram44 / non_d3m_datasets.ipynb
Created February 23, 2021 18:42
Windows test 2
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@remram44
remram44 / non_d3m_datasets.ipynb
Created February 23, 2021 01:31
Windows test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@remram44
remram44 / create-mapping.sh
Last active January 13, 2021 19:56
Test Elasticsearch's synonym filters to understand them better
#!/bin/sh
set -eu
read_yaml(){
python3 -c 'import json,yaml; print(json.dumps(yaml.safe_load(open("'"$1"'"))))'
}
# Delete mappings
curl -X DELETE http://127.0.0.1:9200/testsynonym || true
#!/bin/sh
set -eu
if [ $# != 1 ] || [ ! -e "$1" ]; then
echo "Usage: $(basename "$0") <video.mkv>" >&2
exit 2
fi
logrun(){
@remram44
remram44 / dep-tree.txt
Created June 24, 2020 16:39
D3M dependency tree from pipdeptree, for primitives:ubuntu-bionic-python36-v2020.5.18-20200619-080545
asn1crypto==0.24.0
autonbox==0.2.0
- d3m [required: Any, installed: 2020.5.18]
- custom-inherit [required: >=2.2.0,<=2.2.2, installed: 2.2.2]
- dateparser [required: >=0.7.0,<=0.7.2, installed: 0.7.2]
- python-dateutil [required: Any, installed: 2.8.1]
- six [required: >=1.5, installed: 1.15.0]
- pytz [required: Any, installed: 2020.1]
- regex [required: Any, installed: 2020.6.8]
- tzlocal [required: Any, installed: 2.1]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@remram44
remram44 / dockerfile
Last active June 11, 2020 20:13
Nominatim config
FROM mediagis/nominatim
# Increase memory limit
RUN find /etc -name php.ini -exec sed -i '/^memory_limit *= *[0-9]/ c memory_limit = 1024M' {} ';'
RUN find /app -name \*.php\* -exec sed -i "s/ini_set('memory_limit', *'[0-9]\+M');/ini_set('memory_limit', '1024M');/" {} ';'
# Enable batch mode
RUN bash -c "cd /app/src/build && echo $'--- settings/settings.php\\n\
+++ settings/settings.php\\n\
@@ -106 +106 @@\\n\