Skip to content

Instantly share code, notes, and snippets.

@solverit
solverit / import
Created July 10, 2023 20:06 — forked from Pliner/import
Mikrotik antifilter.download update script
:do {
:do {
/file remove "/ipsum.rsc";
/file remove "/subnet.rsc";
} on-error={}
:put "Downloading ipsum.rsc...";
:do {
/tool fetch url="https://antifilter.download/list/ipsum.rsc" dst-path="/ipsum.rsc"
} on-error={
lternatively, you can configure your VPN client to ignore the IP ranges that docker uses for the local pool.
For example I've added the following lines to /etc/openvpn/client.conf
which configures OpenVPN to ignore the address ranges 172.16.0.0 - 172.31.255.255:
route 0.0.0.0 128.0.0.0
route 128.0.0.0 224.0.0.0
route 160.0.0.0 248.0.0.0
route 168.0.0.0 252.0.0.0
route 172.0.0.0 255.240.0.0
route 172.32.0.0 255.224.0.0
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
<!Left::
Send, {Home}
return
<!+Left::
@solverit
solverit / powercfg-win10-more-settings.cmd
Created March 9, 2020 21:44 — forked from NominaceTacitus/powercfg-win10-more-settings.cmd
Show/hide hidden settings in Win10 Power Options
@echo on
REM checked for Windows 10
REM fork from https://gist.github.com/theultramage/cbdfdbb733d4a5b7d2669a6255b4b94b
REM you may want full list https://gist.github.com/raspi/203aef3694e34fefebf772c78c37ec2c
REM SET attrib=+ATTRIB_HIDE
SET attrib=-ATTRIB_HIDE
REM Hard disk burst ignore time
powercfg -attributes 0012ee47-9041-4b5d-9b77-535fba8b1442 80e3c60e-bb94-4ad8-bbe0-0d3195efc663 %attrib%
import _root_.slick.ast.Ordering
import _root_.slick.lifted.{BaseColumnExtensionMethods, ColumnOrdered, Query, Rep}
import cats.data.NonEmptyList
import cats.instances.option._
import cats.syntax.apply._
import cats.syntax.either._
object syntax {
implicit class QueryOps[E, U, C[_]](val query: Query[E, U, C]) extends AnyVal {
@solverit
solverit / RAIC.md
Created December 12, 2018 20:56 — forked from kuviman/RAIC.md
Web Renderer for Russian AI Cup

Web renderer for Russian AI Cup

Russian AI Cup — open artificial intelligence programming contest where you can test yourself writing a game strategy! It’s simple, clear and fun! We welcome both novice programmers — students and pupils, as well as professionals. Writing your own strategy is very simple: basic programming skills are enough.

This competition was being held for the sixth time, and this time we made a game of the RTS game genre — players were controlling 500 vehicles of 5 different types at once. The task is to destroy the opponent!

CodeWars 2017

My part was to implement the web renderer — the one you see on the site. There is also a technical renderer with schematic graphics used by participants for local testing.

@solverit
solverit / openssl.MD
Created November 29, 2018 12:57 — forked from jchandra74/openssl.MD
HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

HOWTO: Create Your Own Self-Signed Certificate with Subject Alternative Names Using OpenSSL in Ubuntu Bash for Window

Overview

My main development workstation is a Windows 10 machine, so we'll approach this from that viewpoint.

Recently, Google Chrome started giving me a warning when I open a site that uses https and self-signed certificate on my local development machine due to some SSL certificate issues like the one below:

Self-Signed SSL Issue in Chrome

import scala.concurrent.Future
/** Typeclass for interoperating with legacy code which uses Scala futures. */
trait ExecuteUnsafe[F[_]] {
def unsafeToFuture[T](mt: F[T]): Future[T]
}
object ExecuteUnsafe {
import cats.effect.Async
import cats.implicits._
import scala.concurrent.{ExecutionContext, Future}
import scala.util.{Failure, Success}
/** Typeclass to wrap Scala futures. */
trait Execute[F[_]] {
implicit def async: Async[F]

Applied Functional Programming with Scala - Notes

Copyright © 2016-2018 Fantasyland Institute of Learning. All rights reserved.

1. Mastering Functions

A function is a mapping from one set, called a domain, to another set, called the codomain. A function associates every element in the domain with exactly one element in the codomain. In Scala, both domain and codomain are types.

val square : Int => Int = x => x * x