Skip to content

Instantly share code, notes, and snippets.

View filippovitale's full-sized avatar

Filippo Vitale filippovitale

View GitHub Profile
@filippovitale
filippovitale / extract_lucify_rsrcs.py
Last active August 20, 2020 13:29 — forked from 0xd0cf11e/extract_lucify_rsrcs.py
Scripts for extracting payloads from Lucifer's resources.
import pefile
import argparse
def decrypt_one_byte(b):
key = 0x58 # The xor key hasn’t changed
xor = (b ^ key) & 0xff
return (xor + key) & 0xff
@filippovitale
filippovitale / Main.hs
Last active April 11, 2017 13:43
Akka Stream Flow in Eta
{-# LANGUAGE MagicHash, TypeOperators, MultiParamTypeClasses, TypeFamilies, DataKinds, FlexibleContexts, OverloadedStrings, ScopedTypeVariables #-}
import Java
import Data.Char
import Data.Dynamic
import Data.Typeable
data {-# CLASS "akka.japi.function.Function" #-} Function t r = Function (Object# (Function t r))
deriving Class
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body onload=setInterval(aaa,64)>
<canvas id="c"></canvas>
@filippovitale
filippovitale / Snake.scala
Created February 27, 2017 14:14 — forked from densh/Snake.scala
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
@filippovitale
filippovitale / tea-storm.html
Created February 2, 2017 22:06
Unpacked version (with comments) of the beautiful TEA STORM
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Tea Storm unpacked</title>
</head>
<body onload=setInterval(paint,32)>
<canvas id=c />
@filippovitale
filippovitale / java-signals-test.sh
Created January 3, 2017 16:00 — forked from nicoulaj/java-signals-test.sh
What signals can your JRE handle ?
#!/bin/bash
# Get temp dir
tmpdir=$(mktemp -d)
# Generate test
cat > ${tmpdir}/ListenToSignal.java <<EOF
import sun.misc.Signal;
import sun.misc.SignalHandler;
public class ListenToSignal {
@filippovitale
filippovitale / Genetic Algorithm.ipynb
Created December 19, 2016 22:20
SEND + MORE = MONEY
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@filippovitale
filippovitale / folds.scala
Last active August 29, 2015 14:26 — forked from tonymorris/folds.scala
Fold exercises in Scala
trait MyOption[A] {
def fold[B](n: => B, s: A => B): B
// Define the usual Option API.
//
// * Constructors (on the object)
// some
// none
// * methods
// map
@filippovitale
filippovitale / SendMoreMoneySpec.scala
Created July 6, 2015 12:16
Send + More = Money – ScalaSyd – July 2015
import org.specs2._
import scalaz._, Scalaz._
class SendMoreMoneySpec extends Specification { def is = s2"""
Using the List Monad
List(1, 2) $tl1
List(1, 2) if a != b $tl2
List(1, 2, 3) $tl3
Map('a' -> a, 'b' -> b) $tl4
s.eval(List(1, 2)) $ts1
@filippovitale
filippovitale / FreeConsole
Last active June 4, 2021 06:09
FreeConsole – Simplest end to end example of Coyoneda and Free Monad in Scala
import scalaz.effect.IO
import scalaz.std.function._
import scalaz.{Coyoneda, Free, Monad, State, ~>}
object NonFunctor extends App {
// my simple algebra
sealed trait Console[A]
case class PrintLine(msg: String) extends Console[Unit]
case object ReadLine extends Console[String]