Skip to content

Instantly share code, notes, and snippets.

View blad's full-sized avatar
👾
👾 👾 👾👾 👾 👾 👾 👾

Bladymir Tellez blad

👾
👾 👾 👾👾 👾 👾 👾 👾
View GitHub Profile
@blad
blad / core.clj
Created April 29, 2022 13:59
XML Analyzer
(ns xml-ids.core
(:require [clojure.xml :as xml])
(:require [clojure.string :as string])
(:require [clojure.java.io :as io])
(:gen-class))
(def source-list "list.txt") ;; List of paths to XML layouts, one per line.
(def ignored-tags [:import :data :variable :import :layout :merge :layout])
Training: Marathon Training
Wk: Mo Tu We Th Fr Sa Su
JUNE
0: 0 0 0 0 0 0 2 => 2
0: 0 0 2 0 3 0 0 => 5
0: 0 0 0 0 0 0 0 => 0
JULY
1: 0 3 3 3 0 6 0 => 15
2: 0 3 3 3 0 6 0 => 15
@blad
blad / bezier.lisp
Last active August 26, 2020 01:52
Ronin: Drawing a Bézier Curve
(defn bezier-line
(points color)
(
(def ts (range 0 1 .001))
; Calculate the coordniates of the bezier curve:
(defn bezier-point
(t x0 x1 x2)
(add x1
(mul
(pow
@blad
blad / fill-area.lisp
Last active August 24, 2020 01:46
Ronin: Bucket Implementation
(resize 100 100)
(fill (get-frame) "white")
(stroke (rect 23 26 54 49) "black")
(def f (get-frame))
(def pls 1)
(def mns (sub 0 1))
(defn shift-x (p a)
(pos (clamp (add p:x a) 0 f:w) p:y))
@blad
blad / black-transparent.lisp
Last active August 23, 2020 12:12
Ronin: Black-Transparent-Mask
;; 1. Create Black-Transparent Mask from Black-White Image:
(open $path .15)
(defn bw-to-alpha
(p)
(p:0 p:1 p:2 (sub 255 p:0)))
(defn to-black-transparent
(pixel q)
(bw-to-alpha pixel))
@blad
blad / petal.lisp
Last active August 22, 2020 20:43
Ronin: Petal Composite
(clear)
(def c:x 300)
(def c:y 300)
(def c:r 200)
(def petal-color (gradient (line 160 165 299 297) ("gold" "goldenrod")))
; Draw Background:
(fill (get-frame) (gradient (line 301 300 301 5) ("#333" "#222")))
(fill
@blad
blad / append-implementation.lisp
Created August 22, 2020 19:18
Ronin: Implement Append using user-space functions.
(def y ())
(defn identity (x) x)
(defn copy-list
(xs)
(map xs identity))
(defn append
(xs item)
@blad
blad / SampleDots.lisp
Created August 22, 2020 14:10
Ronin: Apply Dot Effect to Imported Image
(clear)
(open $path .5)
(def background "black")
(def unit 10)
(def padding 1)
(def r (sub (div unit 2) padding))
(def f (get-frame))
@blad
blad / wallpaper.lisp
Created August 22, 2020 13:22
Ronin Transparent Lines Wallpaper
(def background "#242424")
(def dark "#72dec211")
(def light "#72dec222")
(def segment:l 400)
(def segment:shift 2)
(def screeen:w 1280)
(def screeen:h 800)
@blad
blad / wallpaper.lisp
Created August 21, 2020 15:33
Ronin: Star Wallpaper
; Lain Script for Ronin
; https://hundredrabbits.github.io/Ronin/
(def win
(js))
(def screen
(:screen win))
(clear)