HICORE前端组件库
doway组件库
Pi-to-Pi local bidirectional communication: run peer Pi agents that can message each other on the same machine.
vue3、element-plus、typeScript
Give a regex, get a robust predicate function that tests it against a string.
Helper functions
test for inclusion or exclusion of paths using globs
Pure JS implementation of CRC32 https://en.wikipedia.org/wiki/Cyclic_redundancy_check
A pure JS implementation SHA256.
SHA256 wrapper for browsers that prefers `window.crypto.subtle` but will fall back to a pure JS implementation in @aws-crypto/sha256-js to provide a consistent interface for SHA256.
A high-level API to automate web browsers
Pure JS implementation of CRC32-C https://en.wikipedia.org/wiki/Cyclic_redundancy_check
Cross platform children list of a PID
A high-level API to automate web browsers
SHA1 wrapper for browsers that prefers `window.crypto.subtle`.
一个为ai打造的vue组件库
## Project setup ``` npm install ```
Parameterised tests for Jest
## Project setup ``` npm install ```
vue3 ai component
Provides functions for detecting if the host environment supports the WebCrypto API
unist utility to check if a node passes a test
A babel plugin that adds istanbul instrumentation to ES6 code
No description provided.
Esta gem foi criada com o objetivo de agilizar o processo de estruturação de uma stack de automação de testes com ruby, e capybara.
Esta gem foi criada com o objetivo de agilizar o processo de estruturação de uma stack de automação de testes com ruby, e capybara.
SemillaGen let's you create (Actionscript3.0 based) projects and classes with ease. SemillaGen generated projects or classes are customizable via templates. The default templates setup the project for Continuous Integration using FlexUnit. the default class template creates a class and a test case automatically. usage: To create a new project run: $ semillagen project MyAwesomeProject $ ls MyAwesomeProject To create a new class with test case: $ cd MyAwesomeProject $ semillagen class com.semilla.MillionDollarClass You will see that semillagen created the following files: src/com/semilla/MillionDollarClass.as test-src/com/semilla/MillionDollarClassTest.as The default template is ready for building as soon as created. To build and test your project we use rake. $ rake Rake will build a debug and release versions of your project. It will also create a FlexUnit test swf and run the test. You will see the results of the tests and also you will see some xml files under the [test-report] folder. These reports are JUnit compatible. You can use a CI tool like Jenkins to automatically build and test your project.
A gem `inscricao_estadual` fornece ferramentas para **gerar** e **validar** inscrições estaduais (IE) para empresas brasileiras, de acordo com as regras específicas de cada estado (UF). Ideal para aplicações fiscais, ERPs e automações que exigem validação de IE em cadastros de CNPJ. Recursos: - Validação de IE por estado com regras específicas - Geração de IE válidas para testes - Interface simples e extensível - Suporte inicial a alguns estados (ex: GO) Foco principal: validar corretamente a IE conforme os dígitos verificadores e formatos usados nas SEFAZ estaduais.
# StudioGame (Alec) Jogo de terminal em Ruby com **jogadores, dados, tesouros e variações de jogadores** (Clumsy e Berserk), empacotado como gem. > Nome do gem (exemplo): `studio_game_alec` --- ## 🚀 Instalação e execução ### Rodando direto do código-fonte No diretório do projeto: ```bash ruby bin/studio_game ``` Se você não passar um arquivo de jogadores via CLI, o script usa o `players.csv` que fica em `bin/` por padrão. Também funciona passando um CSV na linha de comando: ```bash ruby bin/studio_game my_favorite_players.csv ``` ### Como gem (local) Empacote e instale localmente: ```bash gem build studio_game.gemspec gem install studio_game_alec-<versao>.gem ``` Depois rode: ```bash studio_game ``` > No Windows, o executável será resolvido pelo RubyGems. Se preferir, rode: `ruby bin/studio_game`. --- ## 📁 Estrutura do projeto ``` games/ ├─ bin/ │ ├─ studio_game # script principal (tem shebang) │ └─ players.csv # CSV padrão (nome,vida) ├─ lib/ │ └─ studio_game/ │ ├─ auditable.rb │ ├─ berserk_player.rb │ ├─ clumsy_player.rb │ ├─ die.rb │ ├─ game.rb │ ├─ game_turn.rb │ ├─ loaded_die.rb │ ├─ playable.rb │ ├─ player.rb │ └─ treasure_trove.rb ├─ spec/ │ └─ studio_game/ # specs RSpec ├─ LICENSE ├─ README.md └─ studio_game.gemspec ``` - **Namespace:** todo o código vive dentro do módulo `StudioGame` para evitar colisões. - **bin/studio_game:** script CLI com shebang (`#!/usr/bin/env ruby`). Faz _fallback_ do `$LOAD_PATH` para `lib` quando usado fora da gem. - **lib/studio_game/**: código da biblioteca (classes/módulos). - **spec/**: testes RSpec. --- ## 🧩 Conceitos principais - **Player** (`player.rb`): representa um jogador com `name`, `health`, coleta tesouros e calcula `score` (= `health` + `points`). Inclui o mixin **Playable**. - **Playable** (`playable.rb`): mixin com `w00t`, `blam` e `strong?` (altera/consulta `health` via getters/setters). - **TreasureTrove** (`treasure_trove.rb`): define `Treasure = Struct.new(:name,:points)` e a constante `TREASURES`; possui `.random`. - **Die/LoadedDie** (`die.rb`, `loaded_die.rb`): rolam valores (o carregado favorece 1,1,2,5,6,6). Ambos incluem **Auditable**. - **Auditable** (`auditable.rb`): imprime “Rolled a X (DieClass)” após cada rolagem. - **Game** (`game.rb`): agrega jogadores, carrega CSV, executa rodadas, soma pontos e salva _high scores_. - **GameTurn** (`game_turn.rb`): executa a lógica de um turno para um jogador (rola dado, aplica `blam/w00t/skip` e concede tesouro). - **ClumsyPlayer / BerserkPlayer**: variações de `Player` que modificam comportamento de `w00t` e de coleta de tesouros. --- ## 🧪 Testes Rode todos os testes: ```bash rspec ``` Principais coisas testadas: - Ordenação de jogadores por `score` (usa `<=>` em `Player`). - Cálculo de `points` e `score` (soma de tesouros + vida). - Efeitos de `w00t`/`blam` e força (`strong?`). - Lógica de turno com _stubs_ de dado (`allow_any_instance_of(LoadedDie).to receive(:roll).and_return(n)`). - Comportamentos de `ClumsyPlayer` e `BerserkPlayer`. --- ## 📦 CSVs e caminhos - `bin/studio_game` resolve o CSV padrão assim: ```ruby default_player_file = File.join(File.dirname(__FILE__), 'players.csv') game.load_players(ARGV.shift || default_player_file) ``` - Você pode passar um arquivo `.csv` via CLI como primeiro argumento. Formato do CSV: ``` Moe,100 Larry,60 Curly,125 ``` --- ## 🧾 High Scores Após sair do loop, o jogo grava `high_score.txt` com as entradas ordenadas. Cada linha é formatada por `Game#high_score_entry`: ``` <nome com padding de pontos> <score> ``` --- ## 🛠️ Dicas de desenvolvimento - Use `require 'studio_game/arquivo'` quando a gem estiver instalada. - No script binário, o `begin/rescue LoadError` faz _fallback_ para `$LOAD_PATH` local, útil fora da gem. - Para debugar I/O em testes, o spec redireciona `STDOUT` (`$stdout = StringIO.new`). --- ## 📚 Licença MIT – veja o arquivo `LICENSE`.
# Crowdfund (Alec) Ferramenta de linha de comando e biblioteca Ruby para simular um programa de **arrecadação de fundos** com rodadas, promessas (pledges) e diferentes tipos de projetos (básico, com *matching*, e *grant*). ## Instalação ```bash gem install crowdfund_alec ``` Ou rode a partir do código-fonte: ```bash ruby bin/crowdfund ``` ## Como funciona - Você carrega projetos via CSV (nome, fundos_iniciais, meta). - Em cada rodada, um dado é rolado para **adicionar** (+25) ou **remover** (–15) fundos do projeto. - Em paralelo, o projeto recebe **pledges** aleatórios: bronze ($50), silver ($75), gold ($100). - Projetos podem ter comportamento especial: - **MatchingProject**: quando chega a 50% da meta, cada `add_fund` passa a dobrar (+50). - **GrantProject**: nunca perde fundos em `remove_fund`. - Ao sair, o relatório salva os **subfinanciados** em `needmoremoney.txt` e imprime estatísticas. ## Uso (CLI) ```bash # (1) CSV padrão (bin/projects.csv) ruby bin/crowdfund # (2) Informando um CSV customizado ruby bin/crowdfund caminho/para/projetos.csv ``` Durante a execução: - Digite um número para a quantidade de rodadas. - Digite `q` ou `e` para sair e ver o relatório final. ### Formato do CSV ``` NomeDoProjeto,fundos_iniciais,meta BuyaBoat,5,10000 TraveltoVictoriaIsland,5,3000 GetaPuppy,5,300 ``` ## Saída esperada - Resumo por rodada dos fundos e pledges recebidos. - Arquivo `needmoremoney.txt` contendo: - Título do relatório. - Projetos totalmente financiados. - Projetos subfinanciados ordenados por **quanto falta**. - Snapshot CSV de todos os projetos. ## API (uso como biblioteca) Requerendo as classes principais: ```ruby require 'crowdfund/project' require 'crowdfund/fund_request' ``` Criando projetos e executando rodadas: ```ruby project = Project.new("My App", 500, 2000) funding = FundRequest.new("Startup do Alec") funding.add_project(project) funding.request_funding(5) funding.print_results ``` ### Classes principais - `Project` - Atributos: `name`, `fund_amount`, `target_fund_amount` - Métodos: `add_fund`, `remove_fund`, `funds_needed`, `funded?`, `received_pledge`, `pledges`, `total_funds`, `each_received_pledge`, `to_csv`, `status` - `FundRequest` - Gerencia lista de projetos, executa rodadas, imprime e salva relatórios. - `MatchingProject < Project` - Dobra `add_fund` quando `halfway_funded?` (>= 50% da meta). - `GrantProject < Project` - Sobrescreve `remove_fund` para nunca diminuir fundos. - `Pledgesmod` - Constante `PLEDGES` e `.random` para escolher bronze/silver/gold. - `FundingRound` - Regras de uma rodada: rola `Die`, aplica `add/remove`, atribui pledge. - `Fundable` (mixin) - Implementa `add_fund`, `remove_fund`, `funds_needed`, `funded?`. - `Die` - D6 simples com `roll`. ## Testes Rodar todos os testes: ```bash rspec ``` Principais cenários cobertos: - Regras de `add_fund`/`remove_fund`. - Comportamento de `MatchingProject` e `GrantProject`. - Integração de `FundingRound` e `Pledgesmod`. - Geração do relatório em `FundRequest`. ## Licença MIT — consulte o arquivo `LICENSE`.
= dm-is-published This plugin makes it very easy to add different states to your models, like 'draft' vs 'live'. By default it also adds validations of the field value. Originally inspired by the Rails plugin +acts_as_publishable+ by <b>fr.ivolo.us</b>. == Installation # Add GitHub to your RubyGems sources $ gem sources -a http://gems.github.com $ (sudo)? gem install kematzy-dm-is-published <b>NB! Depends upon the whole DataMapper suite being installed, and has ONLY been tested with DM 0.10.0 (next branch).</b> == Getting Started First of all, for a better understanding of this gem, make sure you study the '<tt>dm-is-published/spec/integration/published_spec.rb</tt>' file. ---- Require +dm-is-published+ in your app. require 'dm-core' # must be required first require 'dm-is-published' Lets say we have an Article class, and each Article can have a current state, ie: whether it's Live, Draft or an Obituary awaiting the death of someone famous (real or rumored) class Article include DataMapper::Resource property :id, Serial property :title, String ...<snip> is :published end Once you have your Article model we can create our Articles just as normal Article.create(:title => 'Example 1') The instance of <tt>Article.get(1)</tt> now has the following things for free: * a <tt>:publish_status</tt> attribute with the value <tt>'live'</tt>. Default choices are <tt>[ :live, :draft, :hidden ]</tt>. * <tt>:is_live?, :is_draft? or :is_hidden?</tt> methods that returns true/false based upon the state. * <tt>:save_as_live</tt>, <tt>:save_as_draft</tt> or <tt>:save_as_hidden</tt> converts the instance to the state and saves it. * <tt>:publishable?</tt> method that returns true for models where <tt>is :published </tt> has been declared, but <b>false</b> for those where it has not been declared. The Article class also gets a bit of new functionality: Article.all(:draft) => finds all Articles with :publish_status = :draft Article.all(:draft, :author => @author_joe ) => finds all Articles with :publish_status = :draft and author == Joe Todo Need to write more documentation here.. == Usage Scenarios In a Blog/Publishing scenario you could use it like this: class Article ...<snip>... is :published :live, :draft, :hidden end Whereas in another scenario - like in a MenuItem model for a Restaurant - you could use it like this: class MenuItem ...<snip>... is :published :on, :off # the item is either on the menu or not end == RTFM As I said above, for a better understanding of this gem/plugin, make sure you study the '<tt>dm-is-published/spec/integration/published_spec.rb</tt>' file. == Errors / Bugs If something is not behaving intuitively, it is a bug, and should be reported. Report it here: http://github.com/kematzy/dm-is-published/issues == Credits Copyright (c) 2009-07-11 [kematzy gmail com] Loosely based on the ActsAsPublishable plugin by [http://fr.ivolo.us/posts/acts-as-publishable] == Licence Released under the MIT license.
No description provided.
No description provided.