Skip to content

Instantly share code, notes, and snippets.

View Mithrandir0x's full-sized avatar

Oriol López Sánchez Mithrandir0x

View GitHub Profile
@Mithrandir0x
Mithrandir0x / lc_protocol.c
Last active August 29, 2015 14:10
Trames de capa de control d'enllaç
#include "lc_protocol.h"
/**
* Link Control Packet Definitions
*/
#define LC_PCK_BROADCAST_REQUEST 0xFF
#define LC_PCK_NODE_RESPONSE 0x0F
#define LC_PCK_START_VRT 0xAE
#define LC_PCK_VRT_STARTED 0xAA
#define LC_PCK_DATA_REQUEST 0x13
@Mithrandir0x
Mithrandir0x / spoon-wrap.sh
Last active August 29, 2015 14:27
Fix Spoon shortcut for fuck's sake
#!/bin/sh
# -> Set your JDK (not really required, but I'm paranoid) <-
export JAVA_HOME=/etc/jdk1.8.0_45_x64
# -> Set this variable's value to your spoon's path <-
SPOON_DIR=/home/oriollopez/Aplicaciones/spoon-data-integration
#DIR=`pwd`
#echo "Current directory [$DIR]"
[root@hbase scripts]# python yarn-utils.py -c 2 -m 16 -d 3 -k True
Using cores=2 memory=16GB disks=3 hbase=True
Profile: cores=2 memory=12288MB reserved=4GB usableMem=12GB disks=3
Num Container=4
Container Ram=3072MB
Used Ram=12GB
Unused Ram=4GB
yarn.scheduler.minimum-allocation-mb=3072
yarn.scheduler.maximum-allocation-mb=12288
yarn.nodemanager.resource.memory-mb=12288
@Mithrandir0x
Mithrandir0x / fun.scala
Created March 6, 2018 08:24
Functed, Tupled and Curried
scala> def foo(x: Int, y: Double) = x * y
foo: (x: Int,y: Double)Double
scala> foo _
res0: (Int, Double) => Double = <function2>
scala> foo _ tupled
res1: ((Int, Double)) => Double = <function1>
scala> foo _ curried
import cats.effect.{ContextShift, IO, Timer}
import fs2.concurrent.SignallingRef
import fs2.Stream
import scala.concurrent.duration._
import scala.concurrent.ExecutionContext.global
object ConcurrentlySnippet {
def enableSignal(signal: SignallingRef[IO, Boolean]): Stream[IO, Unit] =