Skip to content

Instantly share code, notes, and snippets.

View ytmytm's full-sized avatar

Maciej Witkowiak ytmytm

View GitHub Profile
@ytmytm
ytmytm / vdc-256x200.s
Last active April 6, 2022 21:58
VDC setup for 256x200 bitmap mode
// VDC 256x200 modes
// by YTM/Elysium, 2022
//
// in C64 mode (with cartridge or due to holding C= key) call VDC_Init first
// in C128 mode proper VDC timings are already initialized by Kernal
//
// (for KickAssembler)
// BasicUpstart128 macro from https://github.com/wiebow/examples.c128
@ytmytm
ytmytm / pilight-yooda.ino
Created August 24, 2019 21:02
Yooda shades pulse train strings recorded by ESPilight (pilight clone for ESP8266)
/*
This doesn't allow for full protocol decode, I have only 1-channel remote.
rf433_mhz confirms the pulse length settings: 4800,1500,700,350,8000
----UP------8<---------UP-----------
YOODA UP
string format: c:0123232323232332323232323232323223232323233223323223233232323232233232322323232334;p:4797,1506,722,352,8019@
@ytmytm
ytmytm / miasta.xlsx
Last active May 7, 2017 17:39
TSP problem over major cities in Poland
@ytmytm
ytmytm / circmean.R
Created February 17, 2017 23:16
Mean direction and mean strength of wind by vector addition
# circular means by using vector method ####
# from http://math.stackexchange.com/questions/44621/calculate-average-wind-direction
circmean <- function(ws,wd,na.rm=TRUE) {
V_east = mean(ws*sin(wd * pi/180),na.rm=na.rm)
V_north = mean(ws*cos(wd * pi/180),na.rm=na.rm)
mean_WD = atan2(V_east, V_north) * 180/pi
mean_WD = (360 + mean_WD) %% 360
return(mean_WD)
}
circlength <- function(ws,wd,na.rm=TRUE) {
@ytmytm
ytmytm / overratedFilms.R
Created May 14, 2014 19:55 — forked from blmoore/overratedFilms.R
Confront audience score with critics score
library("RCurl")
library("jsonlite")
library("ggplot2")
library("RColorBrewer")
library("scales")
library("gridExtra")
api.key <- "yourAPIkey"
rt <- getURI(paste0("http://api.rottentomatoes.com/api/public/v1.0/lists/dvds/top_rentals.json?apikey=", api.key, "&limit=50"))