This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /result |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import annotations | |
| import argparse | |
| import base64 | |
| import code | |
| import dataclasses | |
| import enum | |
| import functools | |
| import json | |
| import logging | |
| import os |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # /app/components/link_as_button.rb | |
| class LinkAsButton | |
| attr_reader :href | |
| attr_reader :disabled | |
| def initialize( | |
| href:, | |
| disabled: false, | |
| &blk, | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| minitest-same-file $ ruby fib.rb | |
| minitest-same-file $ ruby -rminitest/autorun fib.rb | |
| Run options: --seed 15401 | |
| # Running: | |
| . | |
| Finished in 0.000960s, 1041.6668 runs/s, 1041.6668 assertions/s. | |
| 1 runs, 1 assertions, 0 failures, 0 errors, 0 skips |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'nokogiri' | |
| def minify_html(html) | |
| doc = Nokogiri::HTML.parse(html) | |
| doc.xpath('//comment()').each { |comment| comment.remove } | |
| doc.to_html(save_with: Nokogiri::XML::Node::SaveOptions::AS_HTML) | |
| end | |
| html_code = '<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Bla bla bla</title></head><body><p>Abc <!--stuff to remove--></p></body></html>' | |
| puts minify_html(html_code) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_relative 'parser' | |
| class Arithmetic | |
| include ParserCombinators | |
| def root | |
| expression | |
| end | |
| def expression |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require_relative 'import' | |
| B = import "b" | |
| p defined?(::User) | |
| user = B.new_user | |
| p user | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define REFLECT(x) template<class R> void reflect(R& r) { r x; } | |
| #include <string> | |
| struct Person { | |
| std::string name; | |
| int age; | |
| REFLECT( | |
| ("name", name) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![recursion_limit="100"] | |
| use std::io; | |
| use std::io::{Write, Read}; | |
| use std::num::Wrapping; | |
| struct Tape<'a> { | |
| stdin: &'a mut Read, | |
| stdout: &'a mut Write, | |
| data: Vec<Wrapping<u8>>, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| set -e | |
| DIR="docs" | |
| BRANCH="gh-pages" | |
| # Stage all files in the directory | |
| find "$DIR" -type f | xargs git update-index --add | |
| # Write the sub-tree | |
| TREE=$(git write-tree --prefix="$DIR") |
NewerOlder