Skip to content

Instantly share code, notes, and snippets.

View ScalaWilliam's full-sized avatar
🏠
Working from home

ScalaWilliam ScalaWilliam

🏠
Working from home
View GitHub Profile
@keynmol
keynmol / README.md
Last active June 18, 2024 13:13
Scala example of using htmx

What follows are some of my (very) rough thoughts on what we can and should do with respect to CPS transformation in Scala at the language level. I'll try to start with some motivation behind my thinking, as well as some rambling observations on the nature of the problem space, but don't expect too much coherence here. :-)

The Problem

Async programming is hard.

Okay let's actually be more specific than that. High-performance I/O is hard. Signal multiplexing is a powerful technique for achieving high(er) performance I/O, particularly network I/O, but the tradeoff is that, in order to utilize it, the user-space programming model must allow for suspension and resumption of sequential continuations (often called "fibers" or "coroutines"). Achieving this type of programming model without significant tradeoffs in usability is what is exceptionally hard.

If that wasn't bad enough though, these problems are inextricably conflated with another set of problem spaces which are, themselves, very difficult. In

@gbrow004
gbrow004 / ubuntu-MBP-16.md
Last active October 19, 2024 07:52
Ubuntu on Apple Macbook Pro 16-inch (2019)

Update!

This gist is out of date and I can no longer help much, as I got rid of my Mac.

Please visit T2 Linux website for more and better information:

https://t2linux.org/

Acknowledgements

This gist is just a compilation of the hard work that others have put in. I'm not a software developer, so if there are any mistakes or better ways of doing things, I'd appreciate any suggestions. Here's a list of the real heroes who made this possible:

@RobertAKARobin
RobertAKARobin / python.md
Last active November 17, 2024 21:07
Python Is Not A Great Programming Language
@nebtrx
nebtrx / SharedStateZIO.scala
Last active November 7, 2019 06:25
Shared State with `ZIO` instead of `cats-effects`
package com.github.sharedstate
import scalaz.zio.{App, IO, Ref, Void}
import scala.concurrent.duration._
object SharedStateZIO extends App {
// this is a simpler alternative to `scalaz.zio.console.putStrLn`
def putStrLn(str: String): IO[Void, Unit] = IO.sync(println(str))
def process1(myState: Ref[List[String]]): IO[Void, Unit] = {
@mystroken
mystroken / article-item-list.html
Last active November 8, 2021 19:37
Structured Data Markups using Microdata - https://schema.org
<article role="article" itemid="http://example.com/article-1" itemscope itemtype="http://schema.org/BlogPosting">
<link itemprop="mainEntityOfPage" href="http://example.com/article-1" />
<h2 itemprop="headline">
<a itemprop="url" href="#" title="">Article title</a>
Coming this April, HBO NOW will be available exclusively in the U.S. on Apple TV and the App Store.
</h2>
<img itemprop="image" src="http://images.apple.com/live/2015-mar-event/images/573cb_xlarge_2x.jpg">
<p>
Published by <cite itemprop="author" itemscope itemtype="http://schema.org/Person"><span itemprop="name">Mystro Ken</span></cite>
<time itemprop="datePublished" datetime="2015-03-09T13:08:00-07:00">March 9, 2015 1:08PM</time>
@Grogs
Grogs / FileCache.scala
Last active June 4, 2022 22:58
File backed implementation of ScalaCache Cache
import java.nio.ByteBuffer
import java.nio.channels.{AsynchronousFileChannel, CompletionHandler, FileLock}
import java.nio.file.StandardOpenOption.{CREATE, READ, WRITE}
import java.nio.file._
import java.util.concurrent.{Executors, TimeUnit}
import scala.compat.java8.FunctionConverters.asJavaConsumer
import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration.Duration
import scala.concurrent.{ExecutionContext, Future, Promise}
@retronym
retronym / notes.md
Last active June 4, 2017 03:44
SBT launcher notes

SBT Launcher

Status Quo

sbt/launcher is a small Scala application that bootstraps an arbitrary Scala program (typically, SBT) described a config file and sourced via Ivy dependency resolution.

This creates a child classloader containing Scala 2.10.6. A child of this contains SBT itself and xsbti/interface-0.13.11.jar.

Jitpack

https://jitpack.io

For testing purposes, the easiest way to go is jitpack:

resolvers += "jitpack" at "https://jitpack.io"
libraryDependencies += "com.github.User" % "Repo" % "Tag"
@paulp
paulp / global.sbt
Last active October 16, 2018 19:09
continuous compilation of the sbt build
// These lines go in ~/.sbt/0.13/global.sbt
watchSources ++= (
(baseDirectory.value * "*.sbt").get
++ (baseDirectory.value / "project" * "*.scala").get
++ (baseDirectory.value / "project" * "*.sbt").get
)
addCommandAlias("rtu", "; reload ; test:update")
addCommandAlias("rtc", "; reload ; test:compile")
addCommandAlias("ru", "; reload ; update")