This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you wonder how to create a stream from a callback API, you can use this kind of code (note the forever): | |
# I guess Task can be replaced by other ZIO constructs | |
ZStream.fromEffect( | |
Task.effectAsync[T] { cb => | |
cb(Task.succeed(...)) | |
} | |
).forever |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ... | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
# needs config.rb at the root |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package example | |
import cats.effect.{IO, Sync} | |
import cats.kernel.laws._ | |
import cats.kernel.laws.discipline._ | |
import cats.{Eq, Monad} | |
import org.scalacheck.Gen._ | |
import org.scalacheck.Prop._ | |
import org.scalacheck._ | |
import org.scalatest._ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Replace line : | |
Chart chart = new Chart(); | |
// by : | |
Chart chart = new Chart(new AWTChartComponentFactory(), Chart.DEFAULT_QUALITY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TestConcurrence { | |
public static void main(String[] args) { | |
String address = "http://localhost:8080/servicejava/serverStatefull"; | |
System.out.println("*****************************"); | |
final WebTarget target = AppliCliente.clientJAXRS().target(address); | |
final Automate automate = WebResourceFactory.newResource(Automate.class, target); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Select all spaces not between quotes | |
Useful for command line parsing | |
""" +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)""" | |
Scala example : | |
scala> val input = "hello world \"john doe\"" | |
input: String = hello world "john doe" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRC = src | |
SOURCES = $(shell find ./src/ -name *.java) | |
S = java | |
SC = javac | |
TARGET = bin | |
CP = bin | |
VPATH=bin | |
run: compile | |
@echo ":: Executing..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <signal.h> | |
static void handler(int signum) | |
{ | |
write(1, "NOPE", 4); | |
fork(); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Xcursor.theme: Vanilla-DMZ-AA | |
!urxvt color scheme: | |
URxvt*background: #2B2B2B | |
URxvt*foreground: #DEDEDE | |
!URxvt*colorUL: #86a2b0 | |
! black |