concatenate pull-streams
Run a child as if it's the foreground process. Give it stdio. Exit when it exits.
Node.js Streams, a user-land copy of the stream library from Node.js
> [!NOTE] > This is a fork of https://github.com/cafreeman/remove-types. It's not marked as a fork because we want pull requests to target this repo and not "upstream".
Fast 0-deps bash parser written in TypeScript
Resolve the path of a globally installed module
Excel Workbook Manager - Read and Write xlsx and csv Files.
BEM React ClassName
The core implementation of ConfigCat providers. This is a shared core package. Application developers should use one of the more specific providers instead:
Create class mock instances easily with Jest
Measure the difference between two strings using the Levenshtein distance algorithm
Create react contexts with zustand
Anthropic Sandbox Runtime (ASRT) - A general-purpose tool for wrapping security boundaries around arbitrary processes
A small library for transforming TypeScript code into JavaScript code in the least destructive way possible. This library exports a single function whose purpose is to preserve everything else about the code except for the actual TypeScript syntax itself.
Open stuff like URLs, files, executables. Cross-platform.
[](http://www.typescriptlang.org/) [](https://www.npmjs.com/package/@n1ru4l/push-pull-async
Map pull-streams to other pull-streams then concat together
Programmatic API to update package.json
Transform Salesforce Apex code coverage JSONs into other formats accepted by SonarQube, GitHub, GitLab, Azure, Bitbucket, etc.
The lightest signal library.
Command-line syntax highlighter.
A plugin for the serverless framework which helps with configuring caching for API Gateway endpoints.
OCSP Stapling implementation
Sort an Object or package.json based on the well-known package.json keys
Pulls top reddit cats and displays in command line
My SAKURA gem with various utilities. This is my swiss-army knife for Linux and Mac. See README.md for amazing examples, like: richelp ubuntu # shows a richelp of my 'ubuntu' cheatsheet richelp sakura synopsis # shows a richelp of my 'sakura' cheatsheet, grepping for 'synopsis' ls | act # randomly scrambles the lines! Taken from cat/atc ;) ps | rainbow # colors all lines differently twice itunes - # lowers volume of iTunes... twice :) 10 echo Bart Simpson likes it DRY # tells you this 10 times. Very sarcastic script! seq 100 | 1suN 7 # prints every 7th element of the list zombies # prints processes that show zombies (plus funny options to kill them) find . -size +300M | xargs mvto /tmp/bigfiles/ # moves big files to that directory alias gp='never_as_root git pull' # only if u r not root it runs! tellme-time # Tells you the time with Riccardo voice in Italian. Brilliant! find-duplicates . # Tells you files with same size/MD5 in this directory facter is_google_vm # Tells if it's a GCE Virtual Machine
# mdtoc - Markdown Table of Contents Read Markdown files and output a table of contents. ## Installation Requirements: * [Ruby](https://www.ruby-lang.org/en/) (see [.ruby-version](./.ruby-version)) ```bash gem install mdtoc ``` ## Usage ```bash mdtoc --help Usage: mdtoc [options] files or directories... -h, --help Show this message -o, --output PATH Update a table of contents in the file at PATH -a, --[no-]append Append to the --output file if a <!-- mdtoc --> tag isn't found -c, --[no-]create Create the --output file if it does not exist ``` 1. Add a `<!-- mdtoc -->` tag to a Markdown file. ```bash echo '<!-- mdtoc -->' >> README.md ``` 2. Run `mdtoc` and specify input files or directories (eg. the "test/samples" directory) and an output file (eg. "README.md"). ```bash mdtoc -aco README.md test/samples ``` ## Example Rakefile Create a `Rakefile` with the contents below, then run [`rake`](https://github.com/ruby/rake) to: * `git pull` * `git add` any `*.md` files * Run `mdtoc` to update the generated table of contents in the ./README.md file * Git commit and push any changes ```ruby task default: %w[mdtoc] desc 'Update Markdown table of contents and push changes to the git repository' task :mdtoc do command = <<~CMD set -e if [ -n "$(git diff --name-only --diff-filter=U)" ]; then echo 'Error: conflicts exist' >&2 exit 1 fi mdtoc --append --create --output README.md docs/ git add *.md **/*.md git commit -qm 'Update TOC' || true git pull git push CMD sh command, verbose: false do |ok, status| unless ok fail "Failed with status: #{status.exitstatus}" end end end ``` See [andornaut/til](https://github.com/andornaut/til/blob/master/Rakefile) for an example. ## Development ### Setup Requirements: * [Bundler](https://bundler.io/) * [chruby](https://github.com/postmodern/chruby) (recommended) ```bash # Setup development environment bin/setup ``` ### Tasks ```bash # List rake tasks rake -T rake build # Build gem into the pkg directory rake default # Run the build, rubocop, sorbet and test tasks rake install # Build and install gem into system gems rake rubocop # Run RuboCop rake sorbet # Run the Sorbet type checker rake test # Run tests # Run mdtoc with test inputs ruby -Ilib bin/mdtoc test/samples # Run mdtoc with test inputs, and write to a newly created output file f=$(mktemp) && ruby -Ilib bin/mdtoc -aco ${f} test/samples ; cat ${f} ``` ### Publishing 1. Bump version in `lib/mdtoc/version.rb` 2. Run `bundle install` to update `Gemfile.lock` 3. Commit the changes 4. Run `rake release` to publish the gem to RubyGems, create the git tag, and push
# ruby unshare (runshare) This tool allows to unshare Linux namespaces. The implementation is similar to the unshare(1) tool. ## Installation Add this line to your application's Gemfile: ```ruby gem 'runshare' ``` And then execute: $ bundle Or install it yourself as: $ gem install runshare ## Usage > require "runshare" > RUnshare::unshare For example: cat > test.rb require "runshare" pid = RUnshare::unshare( :clone_newpid => true, :clone_newns => true, :clone_newcgroup => true, :clone_newipc => true, :clone_newuts => true, :clone_newnet => true, :clone_newtime => true, :fork => true, :mount_proc => "/proc", # docker export $(docker create hello-world) | tar -xf - -C rootfs :root => "/tmp/rootfs" ) if pid == 0 # child puts "--- #{Process.pid}" if system("/hello") != true raise "bad" end puts "--- done" else # parent puts "-- unshare=#{pid}, pid=#{Process.pid}" puts "-- exit=#{Process.waitpid(pid)}" end ^D sudo ruby -I ./lib ./test.rb ## Quick start $ rake compile && echo 'require "runshare"; RUnshare::unshare(:clone_newuts => true)' | irb install -c tmp/x86_64-linux/runshare/2.4.10/runshare.so lib/runshare/runshare.so cp tmp/x86_64-linux/runshare/2.4.10/runshare.so tmp/x86_64-linux/stage/lib/runshare/runshare.so Switch to inspect mode. require "runshare"; RUnshare::unshare ## Ruby <2.5 If your app is single threaded and you are observing: eval:1: warning: pthread_create failed for timer: Invalid argument, scheduling broken Just ignore it with some degree of bravity. You also can silence it by setting: $VERBOSE = nil ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment. To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/sitano/runshare. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).