Skip to content

Instantly share code, notes, and snippets.

View afiskon's full-sized avatar

Aleksander Alekseev afiskon

View GitHub Profile
#!/usr/bin/env python3
from shapely.geometry.polygon import Polygon
from shapely.geometry.multipolygon import MultiPolygon
from shapely.geometry.linestring import LineString
from shapely.affinity import rotate, translate
import shapely
import shapely.ops as ops
import matplotlib.pyplot as plt
import math
@shirriff
shirriff / edid.py
Created March 25, 2018 15:58
Parse VGA configuration data (EDID) accessed from I2C device 0x50
# Program to parse VGA data (EDID) accessed from I2C device 0x50
#
# This is a quick demo not a supported program, so don't expect
# correctness from it.
#
# Edid format from:
# https://en.wikipedia.org/wiki/Extended_Display_Identification_Data#EDID_1.4_data_format
#
# Ken Shirriff http://righto.com
@spoterianski
spoterianski / hr-logo.ino
Created November 15, 2017 20:50
H&R Logo on ESP32 Wifi Kit (simple demo)
#include <Arduino.h>
#include <U8g2lib.h>
#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif
#ifdef U8X8_HAVE_HW_I2C
#include <Wire.h>
#endif
@densh
densh / Snake.scala
Last active December 19, 2021 05:05
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
import scalanative.native._
import SDL._
import SDLExtra._
@extern
@link("SDL2")
object SDL {
type Window = CStruct0
type Renderer = CStruct0
@ringerc
ringerc / schema.sql
Created February 8, 2016 14:34
Demo Python script for replicating to Solr
CREATE TABLE book_lines
(
id serial primary key,
book_line text not null
);
@miguelmota
miguelmota / README.md
Last active March 16, 2024 12:52
Multiple accounts with Mutt E-Mail Client (gmail example)

How to set up multiple accounts with Mutt E-mail Client

Thanks to this article by Christoph Berg

Instructions

Directories and files

~/
@ocmanv
ocmanv / cabal
Created February 24, 2014 10:06
cabal command line completion
# cabal command line completion
# Copyright 2014 "Osman Veliev" <ocmanv@gmail.com>
#
# Реализовано:
# - кеширование списка пакетов - _cabal_cach()
# - автодополнение версии пакета
# - напоминания об устаревшей базе пакетов - _cabal_log()
# - и установленных версиях пакета - _cabal_installed()
# - автодополнение для "cabal list"
@lelandbatey
lelandbatey / whiteboardCleaner.md
Last active April 25, 2024 02:01
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

@LeSpocky
LeSpocky / rounded_corner.scad
Last active March 4, 2024 21:50
rounded square in openscad
module rounded_square( width, radius_corner ) {
translate( [ radius_corner, radius_corner, 0 ] )
minkowski() {
square( width - 2 * radius_corner );
circle( radius_corner );
}
}
module alternative_square( width, r_c ) {
hull() {