Skip to content

Instantly share code, notes, and snippets.

@oxlb
oxlb / xcode-uninstall.sh
Created July 23, 2020 06:25
SH file to uninstall Xcode from MacOS
killall Xcode
xcrun -k
xcodebuild -alltargets clean
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang/ModuleCache"
rm -rf "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.$(whoami)/ModuleCache"
rm -rf /Applications/Xcode.app
rm -rf ~/Library/Caches/com.apple.dt.Xcode
rm -rf ~/Library/Developer
rm -rf ~/Library/MobileDevice
rm -rf ~/Library/Preferences/com.apple.dt.Xcode.plist
@thobson
thobson / StreamingPoc.scala
Created December 13, 2019 16:45
Monix vs fs2
package com.example
import java.text.NumberFormat
import java.time.Instant
import cats.effect.{IO, Sync, Timer}
import fs2.{Chunk, Stream}
import monix.eval.Task
import monix.execution.Scheduler
import monix.reactive.Observable
@Daenyth
Daenyth / KeyedEnqueue.scala
Created October 9, 2019 14:22
fs2 groupBy / KeyedEnqueue
import cats.Monad
import cats.effect.concurrent.{Ref, Semaphore}
import cats.effect.{Concurrent, Resource}
import cats.implicits._
import fs2.{Pipe, Stream}
import fs2.concurrent.{NoneTerminatedQueue, Queue}
/** Represents the ability to enqueue keyed items into a stream of queues that emits homogenous keyed streams.
*
@kuznero
kuznero / docker-behind-proxy.md
Last active July 6, 2018 17:01
Work with Docker behind proxy

Work with Docker behind proxy

Docker on Linux OS

Following instructions are from official docuementation:

sudo mkdir /etc/systemd/system/docker.service.d
@pathikrit
pathikrit / SudokuSolver.scala
Last active April 12, 2024 15:00
Sudoku Solver in Scala
val n = 9
val s = Math.sqrt(n).toInt
type Board = IndexedSeq[IndexedSeq[Int]]
def solve(board: Board, cell: Int = 0): Option[Board] = (cell%n, cell/n) match {
case (r, `n`) => Some(board)
case (r, c) if board(r)(c) > 0 => solve(board, cell + 1)
case (r, c) =>
def guess(x: Int) = solve(board.updated(r, board(r).updated(c, x)), cell + 1)
val used = board.indices.flatMap(i => Seq(board(r)(i), board(i)(c), board(s*(r/s) + i/s)(s*(c/s) + i%s)))
@staltz
staltz / introrx.md
Last active September 25, 2024 09:04
The introduction to Reactive Programming you've been missing
@rbejar
rbejar / TicTacToe.scala
Last active November 30, 2017 12:22
A functional implementation of Tic-Tac-Toe in Scala. Human vs. computer, computer moves are legal, but purely random.
/*
* Code contributed to Rosetta Code: <http://rosettacode.org/wiki/Tic-tac-toe#Scala>
*
* Creative commons license "CC0 1.0 Universal (CC0 1.0)"
* <http://creativecommons.org/publicdomain/zero/1.0/>
* To the extent possible under law, Rubén Béjar <http://www.rubenbejar.com>
* has waived all copyright and related or neighboring rights to this
* source file. This work is published from: Spain.
*
* Computers vs. human. Human starts.