Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env ruby
# TOO UGLY!
#
# Offline MDN SVG: https://frankfurt.kapeli.com/feeds/zzz/mdn/SVG.tgz
ELEMENTS = %w[
a
animate
animateMotion
# frozen_string_literal: true
module Mahjong
module SVG
Dim = Data.define(:width, :height, :unit) do
def initialize(width:, height:, unit: "mm") = super(width: Float(width), height: Float(height), unit:)
def shortest = deconstruct.min
def longest = deconstruct.max
end
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@roktas
roktas / t.rb
Created October 19, 2022 23:11
require 'open-uri'
require 'json'
content = URI("https://fluxometer.com/rainbow/json/files.json").read
content.delete_prefix!("files(")
content.delete_suffix!(")")
data =JSON.parse(content)
puts data.first
# frozen_string_literal: true
module Checkmark
class Template
def self.[](modul, &block)
Class.new(self, &block).tap { _1.extend(Registerable[modul]) }
end
# attr_reader :type, :layout, :dir
@roktas
roktas / c.rb
Last active June 15, 2022 22:43
# frozen_string_literal: true
require 'delegate'
class Deck < DelegateClass(::Hash)
attr_reader :choosen
def initialize(choosen = nil, **initial)
super(initial)
# frozen_string_literal: true
require 'delegate'
class Deck < DelegateClass(::Hash)
attr_reader :choosen
def initialize(choosen = nil, **initial)
super(initial)
k;double sin()
,cos();main(){float A=
0,B=0,i,j,z[1760];char b[
1760];printf("\x1b[2J");for(;;
){memset(b,32,1760);memset(z,0,7040)
;for(j=0;6.28>j;j+=0.07)for(i=0;6.28
>i;i+=0.02){float c=sin(i),d=cos(j),e=
sin(A),f=sin(j),g=cos(A),h=d+2,D=1/(c*
h*e+f*g+5),l=cos (i),m=cos(B),n=s\
in(B),t=c*h*g-f* e;int x=40+30*D*
{
"default": true,
"line_length": false,
"no-bare-urls": false,
"no-duplicate-heading": false,
"no-emphasis-as-heading": false,
"no-inline-html": false,
"no-trailing-punctuation": false,
"ul-style": { "style": "sublist" },
"header-style": { "style": "setext_with_atx" }
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.