Skip to content

Instantly share code, notes, and snippets.

View jsanz's full-sized avatar
🗺️
Mapping

Jorge Sanz jsanz

🗺️
Mapping
View GitHub Profile
@smith
smith / import.sh
Last active July 1, 2024 13:30
The least complicated way to import a CSV into Elasticsearch
#!/bin/bash
# The simplest possible way to import a CSV into Elasticsearch without having to use a UI or depending on an Elasticsearch client library.
#
# Set $INDEX (the index name to import to) and $URL (the _bulk endpoint URL) environment variables.
#
# Requires `bash`, `awk`, `curl`, and [`mlr`](https://miller.readthedocs.io/en/6.12.0/) (for converting CSV to JSON.)
#
# Usage: sh ./import.sh < filename.csv
@veekaybee
veekaybee / normcore-llm.md
Last active July 21, 2024 13:28
Normcore LLM Reads

Anti-hype LLM reading list

Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.

Foundational Concepts

Screenshot 2023-12-18 at 10 40 27 PM

Pre-Transformer Models

@jeffvestal
jeffvestal / -elastic-nlp-load-huggingface-model-with-zero-shot-example.ipynb
Last active September 7, 2022 15:45
Elastic - NLP - Load HuggingFace Model with Zero Shot Example
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
YT_VIDEO="https://www.youtube.com/watch?v=ydYDqZQpim8"
YT_URL="$(youtube-dl --get-url "$YT_VIDEO")"
OUTF="$HOME/.local/share/namibia/background.png"
mkdir -p "$(dirname -- "$OUTF")"
@jjimenezshaw
jjimenezshaw / mandelbrot.cpp
Created August 12, 2021 13:44
Mandelbrot Set in asciiart in 15 lines
#include <complex>
#include <iostream>
int main() {
const size_t limit = 1000, size = 400; // change 'size' to make it more detailed
const char letters[] = " 123456789abcdefghijklmnopqrstuvwxyz*";
for (size_t iy = 0; iy <= size; iy++) {
for (size_t ix = 0, count = 0; ix <= size; ix++, count = 0) {
std::complex<double> c(-2.0+ix*2.5/size, 1.15-iy*2.3/size), z(0.0, 0.0);
while (std::norm(z) < 4.0 && count++ < limit) z = z*z+c;
std::cout << ((count >= limit) ? letters[0] : letters[std::min(count, sizeof(letters)-2)]);
@joshuat
joshuat / Slack avatar-less sidebar.md
Last active January 19, 2021 08:25
Remove the avatars from your slack sidebar

Slack has listened to feedback and given us a way to toggle off the sidebar avatars.

(This only seems to be available in the Beta channel at the moment)

Display or hide profile photos

  1. From your desktop, click your profile picture in the top right.
  2. Select Preferences from the menu.
  3. Click Sidebar in the left-side column.
  4. Check or uncheck the boxes next to Show profile photos next to DMs.
@stevedodson
stevedodson / README.md
Last active July 18, 2022 14:24
Introduction to supervised machine learning in Elastic webinar - Tuesday, February 25, 2020

Introduction to supervised machine learning in Elastic webinar

Tuesday, February 25, 2020

Wednesday, May 27, 2020 - updated customer_churn.ipynb for version 7.7.0

Monday, November 16, 2020 - updated for version 7.10 and eland 7.10b

Monday, September 20, 2021 - updated customer_churn.ipynb for version 7.14

Monday, February 8, 2022 - updated customer_churn.ipynb for version 8.0

@thomasneirynck
thomasneirynck / geojson_to_index.js
Last active November 23, 2021 08:02
Ingest geojson file into Elasticsearch index. Each feature in the FeatureCollection corresponds to a document in Elasticsearch.
const fs = require("fs");
const elasticsearch = require('elasticsearch');
const oboe = require('oboe');
const geojsonInput = process.argv[2] || 'feature_collection.geojson';
const indexname = process.argv[3] || geojsonInput.split('.')[0] || 'feature_collection';
const geometryFieldName = 'geometry';
const shape_type = process.argv[4] || 'geo_shape';
if (shape_type !== 'geo_point' && shape_type !== 'geo_shape') {
@michellemho
michellemho / fake_911_calls.ipynb
Created September 17, 2018 21:48
Generating Emergency Call Data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.