Skip to content

Instantly share code, notes, and snippets.

View filippovitale's full-sized avatar

Filippo Vitale filippovitale

View GitHub Profile
import React, { useState } from "react"
import PropTypes from 'prop-types'
import "./input.css"
import TypingIndicator from "./TypingIndicator"
const input = (props) => {
const styles = ["plank", "staggered", "split"]
const [stateIsFocused, setStateIsFocused] = useState(false)
#!/usr/bin/awk -f
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff
# My copy here is written in awk instead of C, has no compelling benefit.
# Public domain. @thingskatedid
# Run as awk -v x=xyz ... or env variables for stuff?
# Assumptions: the data is evenly spaced along the x-axis
# TODO: moving average
import scala.io.StdIn.readLine
import scala.util.Try
/**
* Trivial code, anyone would understand what's going on here.
* But requirements change, and we never know in which direction the change will be.
*
* The code has a procedural and interactive nature, how would you go about this in another, let alone better way?
* Still, it has bugs; so let's find them and solve them first
*/
@jdegoes
jdegoes / zio-test.scala
Last active January 6, 2023 14:08
Simple example of testing with ZIO environment
object test {
import scalaz.zio._
type UserID = String
case class UserProfile(name: String)
// The database module:
trait Database {
val database: Database.Service
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// opensimplexnoise code in another tab might be necessary
// --> code here : https://gist.github.com/Bleuje/fce86ef35b66c4a2b6a469b27163591e
int[][] result;
float t, c;
float ease(float p) {
@alexellis
alexellis / kvm_minikube.md
Last active July 21, 2023 10:45
Run multiple minikube Kubernetes clusters on Ubuntu Linux with KVM

Ramp up your Kubernetes development, CI-tooling or testing workflow by running multiple Kubernetes clusters on Ubuntu Linux with KVM and minikube.

In this tutorial we will combine the popular minikube tool with Linux's Kernel-based Virtual Machine (KVM) support. It is a great way to re-purpose an old machine that you found on eBay or have gathering gust under your desk. An Intel NUC would also make a great host for this tutorial if you want to buy some new hardware. Another popular angle is to use a bare metal host in the cloud and I've provided some details on that below.

We'll set up all the tooling so that you can build one or many single-node Kubernetes clusters and then deploy applications to them such as OpenFaaS using familiar tooling like helm. I'll then show you how to access the Kubernetes clusters from a remote machine such as your laptop.

Pre-reqs

  • This tutorial uses Ubuntu 16.04 as a base installation, but other distributions are supported by KVM. You'll need to find out how to install
@densh
densh / Snake.scala
Last active December 19, 2021 05:05
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
import scalanative.native._
import SDL._
import SDLExtra._
@extern
@link("SDL2")
object SDL {
type Window = CStruct0
type Renderer = CStruct0

Advanced Functional Programming with Scala - Notes

Copyright © 2017 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

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