Skip to content

Instantly share code, notes, and snippets.

Avatar
🗺️
Mapping

Jorge Sanz jsanz

🗺️
Mapping
View GitHub Profile
@jeffvestal
jeffvestal / -elastic-nlp-load-huggingface-model-with-zero-shot-example.ipynb
Last active Sep 7, 2022
Elastic - NLP - Load HuggingFace Model with Zero Shot Example
View -elastic-nlp-load-huggingface-model-with-zero-shot-example.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View namibia-waterhole-background.sh
#!/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")"
@joshuat
joshuat / Slack avatar-less sidebar.md
Last active Jan 19, 2021
Remove the avatars from your slack sidebar
View Slack avatar-less sidebar.md

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 Jul 18, 2022
Introduction to supervised machine learning in Elastic webinar - Tuesday, February 25, 2020
View README.md

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 Nov 23, 2021
Ingest geojson file into Elasticsearch index. Each feature in the FeatureCollection corresponds to a document in Elasticsearch.
View geojson_to_index.js
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 Sep 17, 2018
Generating Emergency Call Data
View fake_911_calls.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gif-from-tweet.md

gif-from-tweet

There are so many great GIFs out there and I want to have copies of them. Twitter makes that harder than it should be by converting them to MP4 and not providing access to the source material. To make it easier, I made a bash pipeline that takes a tweet URL and a filename, extracts the MP4 from that tweet and uses ffmpeg to convert back to GIF.

Dependencies

  • ffmpeg
    • macOS: brew install ffmpeg
    • Ubuntu/Debian: apt install ffmpeg
View adjustBrightness.sh
#!/bin/bash
BLIGHT_PATH=$(sudo find /sys -type d -name intel_backlight)
MAX_BRIGHTNESS=$(cat $BLIGHT_PATH/max_brightness)
while [ 1 ]; do
echo "$MAX_BRIGHTNESS*$(fswebcam --png -1 - | convert - -colorspace gray -format "%[fx:mean]" info:)" | \
bc -l | cut -d '.' -f 1 | \
sudo tee $BLIGHT_PATH/brightness;
@nobuti
nobuti / index.html
Created Oct 19, 2017
Almost pure React
View index.html
<html>
<body>
<div id="react-root"></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.0.0/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.0.0/umd/react-dom.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.26.0/babel.min.js"></script>
<script id="react-app" type="text/template">
const App = ({name}) => {