Skip to content

Instantly share code, notes, and snippets.

View extesy's full-sized avatar
💭
I may be slow to respond.

Oleg Anashkin extesy

💭
I may be slow to respond.
View GitHub Profile
@extesy
extesy / clickhouse_import_nyc_taxi.sql
Created June 30, 2020 01:29
Transfer NYC taxi data from a staging log table into a merge table
CREATE TABLE trips_mergetree
ENGINE = MergeTree(pickup_date, pickup_datetime, 8192)
AS SELECT
trip_id,
CAST(if(vendor_id='\\N', '', vendor_id) AS Enum8('' = 0, '1' = 1, '2' = 2, 'CMT' = 3, 'VTS' = 4, 'DDS' = 5, 'B02512' = 10, 'B02598' = 11, 'B02617' = 12, 'B02682' = 13, 'B02764' = 14)) AS vendor_id,
toDate(pickup_datetime) AS pickup_date,
ifNull(pickup_datetime, toDateTime(0)) AS pickup_datetime,
toDate(dropoff_datetime) AS dropoff_date,
ifNull(dropoff_datetime, toDateTime(0)) AS dropoff_datetime,
@extesy
extesy / export_nyc_taxi.sql
Created June 29, 2020 16:01
Export NYC taxi dataset from PostgreSQL in a compressed format
COPY (
SELECT trips.id,
trips.vendor_id,
trips.pickup_datetime,
trips.dropoff_datetime,
trips.store_and_fwd_flag,
trips.rate_code_id,
trips.pickup_longitude,
trips.pickup_latitude,
trips.dropoff_longitude,
@extesy
extesy / keming.py
Created October 29, 2019 22:48
Schmelvetica - Absurd fonts for an absurd world
from fontTools.ttLib import TTFont
import random
import string
ORIGINAL_FONT_PATH = "path/to/Helvetica.ttc"
GLORIOUS_FONT_PATH = "path/to/Schmelvetica.ttc"
NEW_FONTNAME = b"Schmelvetica"
# Load the font
//
// FireworksEffect - Free for all use from Davepl
//
// Fireworks Effect for Fourth of July
public class FireworksEffect : LEDEffect
{
// Each particle in the particle system remembers its color,
// birth time, postion, velocity, etc. If you are not using DateTime,
// all you need in its place is a fractional number of seconds elapsed, which is
@extesy
extesy / key.md
Created February 28, 2019 02:12
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@extesy
extesy / keybase.md
Created February 5, 2016 07:01
keybase.io identity proof

Keybase proof

I hereby claim:

  • I am extesy on github.
  • I am extesy (https://keybase.io/extesy) on keybase.
  • I have a public key whose fingerprint is 4127 2A98 578B A542 47D1 8920 6B08 1EBC 2FF8 D75A

To claim this, I am signing this object:

@extesy
extesy / dabblet.css
Created May 5, 2013 01:03
Circular Tooltip (SO)
/**
* Circular Tooltip (SO)
* http://stackoverflow.com/q/13132864/1397351
*/
* { margin: 0; padding: 0; }
body {
overflow: hidden;
background: url(http://theearlcarlson.com/experiments/amTooltip/img/bg.jpg);
}
/* generic styles for button & circular menu */