Skip to content

Instantly share code, notes, and snippets.

View mkotsur's full-sized avatar

Mike Kotsur mkotsur

View GitHub Profile
# Data taken from
# https://dataplatform.nl/#/data/2346f748-e7e7-4e6d-b630-1009a3c0e9d8
# https://www.cbs.nl/nl-nl/dossier/nederland-regionaal/geografische-data/wijk-en-buurtkaart-2022
# https://www.cbs.nl/nl-nl/maatwerk/2021/31/kerncijfers-wijken-en-buurten-2021
# Packages installation
install.packages("rgeoda")
install.packages("sf")
install.packages("ggplot2")
install.packages("dplyr")
@mkotsur
mkotsur / keynote-to-pdf.scpt
Last active April 3, 2020 06:32
A useful AppleScript snipped that makes a PDF snapshot of your active Keynote presentation without annoying menu clicking
#!/usr/bin/osascript
-- Make sure to update the `pdfPath` variable!
local pdfPath
set pdfPath to "Projects:conf-2020-scalaua:Prototyping-The-Future-ScalaUA-2020.pdf"
local destPath
set destPath to ((path to home folder) as text) & pdfPath
let mileage = 0
const defaultLinkPitch = 10 // milimeters
let cogHealth = 100 // %
const chainCycle = () => {
mileage += 0.000001
const linkPitch = mileage * 2.5
package hello
import io.circe.generic.auto._
import io.github.mkotsur.aws.handler.Lambda._
import io.github.mkotsur.aws.handler.Lambda
import com.amazonaws.services.lambda.runtime.Context
import io.github.mkotsur.aws.proxy
import io.github.mkotsur.aws.proxy.ProxyResponse
import ScalaHandler._
package hello
import scala.beans.BeanProperty
case class ApiGatewayResponse(@BeanProperty statusCode: Integer, @BeanProperty body: String,
@BeanProperty headers: java.util.Map[String, Object], @BeanProperty base64Encoded: Boolean = false)
@mkotsur
mkotsur / MergesortFiles.java
Created December 11, 2015 13:21
MergeSort implementation
import java.io.*;
public class MergesortFiles {
public static void main(String[] bla) throws Exception {
final int MAX_READ_STEP = 15;
final File f1 = new File("/tmp/test.txt");
final File f2 = new File("/tmp/test2.txt");
@mkotsur
mkotsur / init.pp
Created August 2, 2012 13:12
Creating user with password in puppet [works]
class test {
Exec { path => [ "/bin/", "/sbin/" , "/usr/bin/", "/usr/sbin/" ] }
exec { 'uuu':
command => 'sudo useradd -p \'$6$ho0rkgYB$tWX9tiduG4orUmc6Z6hfaha5C4v5xCzK.Xa1d2mSBRW5TwzkgeWap2tUuiEdUQBfo3KnvQi/Y1XjesFFZrMBj1\' myuser'
}
}
@mkotsur
mkotsur / Coords.java
Created December 31, 2011 10:11
Simple tool for determining cursor coordinates
import java.awt.MouseInfo;
import java.awt.Point;
public class Coords {
public static void main(String args[]) throws Exception {
while (true) {
Point spot = MouseInfo.getPointerInfo().getLocation();
System.out.println(String.valueOf(spot.getX()) + "," + String.valueOf(spot.getY()));
Thread.sleep(10);
}
@mkotsur
mkotsur / gist:1312061
Created October 25, 2011 09:42
Stubborn command
r=1; while test "$r" != "0"; do mysql -h 33.33.33.100 -uroot -proot123 dbase; r=$?; sleep 1; done;
@mkotsur
mkotsur / out.log
Created September 13, 2011 08:00
brew install glib failed
ip212-238-53-50:~ mkotsur$ brew doctor
fatal: '/usr/local/Library/Homebrew' is outside repository
Your system is raring to brew.
ip212-238-53-50:~ mkotsur$ brew install glib
==> Downloading ftp://ftp.gnome.org/pub/gnome/sources/glib/2.28/glib-2.28.8.tar.bz2
File already downloaded in /Users/mkotsur/Library/Caches/Homebrew
==> Downloading patches
######################################################################## 100.0%
######################################################################## 100.0%
######################################################################## 100.0%