Links on Must watch talks
-
A Year living Freely - Chris Myers
-
Programs as Values Pure Composable Database Access in Scala. In general each talk from Rob Norris is very useful for learning.
var MyOption, Option; | |
Array.prototype.filter = function(f) { | |
var x, _i, _len, _results; | |
_results = []; | |
for (_i = 0, _len = this.length; _i < _len; _i++) { | |
x = this[_i]; | |
if (f(x)) { | |
_results.push(x); | |
} |
def write(path: String, txt: String): Unit = { | |
import java.nio.file.{Paths, Files} | |
import java.nio.charset.StandardCharsets | |
Files.write(Paths.get(path), txt.getBytes(StandardCharsets.UTF_8)) | |
} | |
def read(path: String): String = | |
scala.io.Source.fromFile(path, "UTF-8").getLines.mkString |
object Entities { | |
case class Review(txt: String, userId: Long, id: Long) | |
case class User(name: String, id: Long) | |
case class ReviewEvent(event: String, reviewId: Long) | |
case class FullReview(r: Review, user: User, evts: Seq[ReviewEvent]) | |
} |
Links on Must watch talks
A Year living Freely - Chris Myers
Programs as Values Pure Composable Database Access in Scala. In general each talk from Rob Norris is very useful for learning.
#!/usr/bin/python3 | |
from bluepy import btle | |
import sys | |
class DiscoLH(btle.DefaultDelegate): | |
def __init__(self): | |
self.devices = [] | |
btle.DefaultDelegate.__init__(self) |
#! /usr/bin/env python3 | |
# This script toggles the PulseAudio output sink of the currently active application (guessed by the currently active X window) between the given output sink and the default output sink. | |
# The output sink is passed as first argument to the script. | |
# | |
# Requirements: | |
# | |
# xdotool (on Ubuntu install via "sudo apt install xdotool") | |
# pulsectl ("sudo pip3 install pulsectl") |
/** | |
* Converts a SASS map of css property names and values into CSS output. | |
* Properties named `description` will have their value inserted as comments. | |
* | |
* Nested maps will be processed recursively. | |
* | |
* @param {map} $map the map of properties to output | |
*/ | |
@mixin map-to-props($map){ | |
@if type-of($map) == map { |
An expression beginning with a left arrow (<-
) inside a do
block statement is desugared to a monadic binding. This is syntactically a superset of existing Haskell, including extensions. It admits a clean notation that subsumes existing patterns and comes with few downsides.
do
f (<- x) (<- y)
-- ===
This guide is completely irrelevant! You no longer need to follow anything here—doing so may actually harm performance rather than helping it. Please tell whoever linked you here that they need to maintain their own guide, if they want to help people set up newer versions of DXVK / etc.
import java.io._ | |
@SerialVersionUID(15L) | |
class Animal(name: String, age: Int) extends Serializable { | |
override def toString = s"Animal($name, $age)" | |
} | |
case class Person(name: String) | |
// or fork := true in sbt |