Skip to content

Instantly share code, notes, and snippets.

View snakeye's full-sized avatar
🔧
Doing things

Andrey Ovcharov snakeye

🔧
Doing things
View GitHub Profile
@snakeye
snakeye / relevance.py
Last active June 21, 2023 12:43
Automatic Relevant Post Suggestions for Static Blogs (Eleventy, Jekyll, etc.)
import argparse
import logging
import os
import string
from typing import List
import frontmatter
import nltk
import numpy as np
from nltk.corpus import stopwords
@snakeye
snakeye / minecraft-server-cloudformation.yml
Last active June 8, 2022 14:46
CloudFormation template to spin up the Minecraft server
---
AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template for Minecraft server
Parameters:
KeyName:
Description: Name of an existing EC2 KeyPair to enable SSH access to the instances
Type: AWS::EC2::KeyPair::KeyName
ConstraintDescription: must be the name of an existing EC2 KeyPair.
InstanceType:
@snakeye
snakeye / keybase.md
Created May 12, 2019 19:31
Keybase proof

Keybase proof

I hereby claim:

  • I am snakeye on github.
  • I am snakeye (https://keybase.io/snakeye) on keybase.
  • I have a public key ASBPPOEK6Mns6SdgJHaz0Ky1m__tpFZE0EWBtok4glTuzQo

To claim this, I am signing this object:

@snakeye
snakeye / calendar_grid.js
Created May 18, 2018 13:13
Create month calendar grid in JavaScript
import moment from 'moment';
const getCalendarGrid = (year, month) => {
let ret = [];
const firstDayOfMonth = moment([year, month - 1, 1]);
const firstDayOfMonthIndex = firstDayOfMonth.day();
// grid row
@snakeye
snakeye / exif_gps.py
Last active July 11, 2024 19:54
Python: get GPS latitude and longitude coordinates from JPEG EXIF using exifread
import exifread
# based on https://gist.github.com/erans/983821
def _get_if_exist(data, key):
if key in data:
return data[key]
return None