Skip to content

Instantly share code, notes, and snippets.

View javipacheco's full-sized avatar

Javier Pérez Pacheco javipacheco

View GitHub Profile
@a4099181
a4099181 / dice.scad
Last active October 27, 2019 20:40
OpenSCAD: dice.
/*
* 6-sided play cube
*/
$fn = 128 ;
WIDTH = 64 ;
DOT_DEEP = 3 ;
DOT_DENSITY = .2 ;
DOT_TABLE = [
[ 2, [ 2, 3, 4, 5, 6 ] ]
@longshorej
longshorej / nl2br.scala
Created April 20, 2016 17:05
scala nl2br with scalatags
import scalatags.Text.all._
object nl2br {
def apply(s: String): Modifier = {
val lines = s.replaceAllLiterally("\r\n", "\n").replaceAllLiterally("\r", "\n").split('\n')
lines.foldLeft(None: Option[Modifier]) { case (step, line) =>
Some(step.fold[Modifier](line)(previous => Vector[Modifier](previous, br, line)))
}.getOrElse("")
}
@chris95x8
chris95x8 / CubicBezierInterpolator.java
Created December 12, 2014 13:59
Bunch of interpolators for awesome animations in Android!
import android.graphics.PointF;
import android.view.animation.Interpolator;
/**
* From https://github.com/codesoup/android-cubic-bezier-interpolator
* Derived from: https://github.com/rdallasgray/bez
*/
public class CubicBezierInterpolator implements Interpolator {