Skip to content

Instantly share code, notes, and snippets.

View silmood's full-sized avatar

Petter Hdz silmood

  • GDG Androidtitlan
  • Mexico City
View GitHub Profile
@silmood
silmood / ccapture-p5js.js
Created July 6, 2021 23:49
ccapture-p5js.js
// Es necesario incluir la librería de CCapture dentro de tu proyecto: https://github.com/spite/ccapture.js/
let capturer
let renderer
let duration = 120
function setup() {
renderer = createCanvas(400, 400)
capturer = new CCapture( { format: 'png', framerate: 60, quality: 30 } )
frameRate(60)
fun main() = application {
configure {
width = 520
height = 520
}
program {
val size = 5 * width / 6.0
val xOffset = -size / 2.0
val yOffset = -size / 2.0
/**
Wave iridescent gradient
*/
int size = 200;
int waveTime = 40;
void setup() {
size(400, 400);
pixelDensity(displayDensity());
fun main() = application {
configure {
width = 500
height = 500
}
program {
val size = 3 * width / 4.0
val easer = SineInOut()
val duration = 50.0
@silmood
silmood / Figuras.kt
Created April 24, 2019 19:18
Ejercicio Claases
import kotlin.math.sqrt
open class Figura(var name: String, var area: Float, var perimetro: Float) {
open fun calcularArea() {
println("Area: ${area}")
}
open fun calcularPerimetro() {
println("Perimetro: ${perimetro}")
}
}
@silmood
silmood / client_browser_console.log
Created January 10, 2019 18:04
Janus ICE Failed
Candidate sent! janus.js:1320:4
Object { janus: "ack", session_id: 1924096615761089, transaction: "xgP56XgEwpQW" }
janus.js:1321:4
Candidate sent! janus.js:1320:4
Object { janus: "ack", session_id: 1924096615761089, transaction: "uXKT36AzQujs" }
janus.js:1321:4
Candidate sent! janus.js:1320:4
Object { janus: "ack", session_id: 1924096615761089, transaction: "jo4O3JTNXQUc" }
janus.js:1321:4
Message sent! janus.js:1254:4
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="142dp">
<com.keepcoding.filmica.view.utils.FadeImageView
android:id="@+id/imgPoster"
android:layout_width="0dp"
object ApiConstants {
val genres: Map<Int, String> = mapOf(
28 to "Action",
12 to "Adventure",
16 to "Animation",
35 to "Comedy",
80 to "Crime",
99 to "Documentary",
18 to "Drama",
10751 to "Family",
@silmood
silmood / ItemOffsetDecorator.kt
Last active November 15, 2018 07:18
ItemOffsetDecorator
class ItemOffsetDecoration(@DimenRes val offsetId: Int) : RecyclerView.ItemDecoration() {
override fun getItemOffsets(outRect: Rect, view: View, parent: RecyclerView, state: RecyclerView.State) {
super.getItemOffsets(outRect, view, parent, state)
val offset = view.context.resources.getDimensionPixelSize(offsetId)
val position = parent.getChildAdapterPosition(view)
val items = parent.adapter?.itemCount ?: 0
if (parent.layoutManager is GridLayoutManager) {
@silmood
silmood / config.yml
Last active June 30, 2018 20:13
Simple CircleCI Android Configuration
# Versión de CircleCI
version: 2
# Pipeline de ejecución
jobs:
build:
working_directory: ~/code
# Imagen de Docker en donde se ejecutarán nuestras pruebas
docker:
- image: circleci/android:api-25-alpha
environment: