Try to downgrade the permissions of a process with root privileges and block access if it fails
Shared type definitions for the Node Slack SDK
Compile ES2015 block scoping (const and let) to ES5
Babel plugin to ensure function declarations at the block level are block scoped
Allow parsing of class static blocks
Transform class static blocks
Gracefully handle a Promise using async/await.
Gracefully handle a Promise using async/await.
🐊Putout plugin adds ability to apply try-catch
Helpers for confirming Solana transactions
Parse and lookup IP network blocks
A simple code writer that assists with formatting and visualizing blocks of code.
Try to downgrade the permissions of a process with root privileges
`Start a promise chain
Tries to execute a function and discards any error that occurs
function try-catch wrapper for promises
code block extension for tiptap
Cross browser stack traces
a stream of blocks
Test whether an object looks like a promises-a+ promise
Wrap `require` in a try/catch block.
app-builder precompiled binaries
Build JSON object for Slack Block Kit surfaces from JSX
Conditional load modules.
macro that makes your error-catching blocks (appear) labmdaless
macro to emulate the upcoming `try` block feature on stable
Some fake try-block macros
Utilities to retry operations that may fail with configurable backoff behavior using macros over blocks of code
try catch blocks for Ruby!
Try block code for a X seconds capturing exceptions.
I will do this, I promise!
Parses blocks of text to find phone numbers (including phonetic numbers), emails, and bad url. Useful for finding scammers who tend to try to post their phone number in messages.
Part honeypot, part defense system. Opens up ports and simulates services in order to look like an attractive target. Hosts that try to connect to the fake services are considered attackers and blocked from all access.
The attempt library provides a thin wrapper for the typical begin/rescue/sleep/retry dance. Use this in order to robustly handle blocks of code that could briefly flake out, such as an http or database connection, where it's often better to try again after a brief period rather than fail immediately.
Squeel unlocks the power of ARel in your Rails 3 application with a handy block-based syntax. You can write subqueries, access named functions provided by your RDBMS, and more, all without writing SQL strings. I'm trying to push a version of this gem, so that bundler doesn't screw up with the :git included versions.
Miscellaneous methods that may or may not be useful. sh:: Safely pass untrusted parameters to sh scripts. Raise an exception if the script returns a non-zero value. fork_and_check:: Run a block in a forked process and raise an exception if the process returns a non-zero value. do_and_exit, do_and_exit!:: Run a block. If the block does not run exit!, a successful exec or equivalent, run exit(1) or exit!(1) ourselves. Useful to make sure a forked block either runs a successful exec or dies. Any exceptions from the block are printed to standard error. overwrite:: Safely replace a file. Writes to a temporary file and then moves it over the old file. tempname_for:: Generates an unique temporary path based on a filename. The generated filename resides in the same directory as the original one. try_n_times:: Retries a block of code until it succeeds or a maximum number of attempts (default 10) is exceeded. Exception#to_formatted_string:: Return a string that looks like how Ruby would dump an uncaught exception. IO#best_datasync:: Try fdatasync, falling back to fsync, falling back to flush. Random#exp:: Return a random integer 0 ≤ n < 2^argument (using SecureRandom). Random#float:: Return a random float 0.0 ≤ n < argument (using SecureRandom). Random#int:: Return a random integer 0 ≤ n < argument (using SecureRandom). Password:: A small wrapper for String#crypt that does secure salt generation and easy password verification.
Abstracts over the interfaces to the various implementation-specific profiling tools
The purpose of this gem is to prevent directly running the inherited methods you choose to block at either the class or instance level, and instead do one of two things: run an alternative block which may or may not invoke the original method, or simply raise an error message. The error message can be customized. The original method can still be called under a different name. The entire object or class can return "unproxied" versions of themselves to preserve the original functionality. This was originally created to help enforce the use of interactors over directly calling ActiveRecord methods like create, save, and update. As with any metaprogramming, this gives you plenty of rope to hang yourself if you try to get too "clever". Treat this library like salt; use sparingly, because over time its cumulative effect will kill you :)
= ebs_conductor The EBS Conductor is a library for managing Amazon Elastic Block Storage volumes and snapshots. It is designed to persist a specific set of data (a "lineage") between different compute instances. EBS Conductor can be used on it's own, but it's most powerful when executed on an EC2 instance using Chef, and the ebs_conductor cookbook[https://github.com/rgeyer/cookbooks/tree/master/cookbooks/ebs_conductor] == Examples === Attach a new 1GB blan volume in the lineage "foobar" to a linux box at /dev/sdb1 ebs_conductor = Rgeyer::Gem::EbsConductor.new('...','...') ebs_conductor.attach_from_lineage('i-abcd1234', 'foobar', 1, '/dev/sdb1') === Attach a specific snapshot to a 1GB volume in the lineage "foobar" to a linux box at /devb/sdb1 ebs_conductor = Rgeyer::Gem::EbsConductor.new('...','...') ebs_conductor.attach_from_lineage('i-abcd1234', 'foobar', 1, '/dev/sdb1' {:snapshot_id => 'snap-abcd1234'}) === Snapshot the lineage "foobar", do not purge any old snapshots in the lineage ebs_conductor = Rgeyer::Gem::EbsConductor.new('...','...') ebs_conductor.snapshot_lineage('foobar') === Snapshot the lineage "foobar", and purge old snapshots so that only 7 remain ebs_conductor = Rgeyer::Gem::EbsConductor.new('...','...') ebs_conductor.snapshot_lineage('foobar', {:history_to_keep => 7}) === Snapshot the lineage "foobar" from the specified volume_id This is useful if you're trying to start a lineage from a "naked" instance, or if you are trying to create a new lineage from an existing one ebs_conductor = Rgeyer::Gem::EbsConductor.new('...','...') ebs_conductor.snapshot_lineage('foobar', {:history_to_keep => 7, :volume_id => 'vol-abcd1234'}) == List of To Do Items * Support for stripes in a lineage == Copyright Copyright (c) 2011 Ryan Geyer. See LICENSE.txt for further details.
# Procer **NOTE: Experimental. Use it to experience what a default `to_proc` could have been. For production code, I recommend an explicit transformation, like the one provided by the gem `jgomo3-func`**. A reasonable good default `to_proc` method for all objects. Install with: ``` gem install procer ``` When you require Procer, all objects will have a default `to_proc` method which will try to call one of the following methods, in the given order: - `call` - `[]` - `===` Many methods which receive a block, can benefit greatly from this because you can now pass an object to perform the block role. Think of the Enumerable module and all its methods. Many objects define `===`, but not `to_proc`. So they will be nicely usable in a `case/when` expression, but not in other contexts. This is the case of classes and ranges, which you can use in `case/when` expressions, but they don't define `to_proc`. Now they do define `to_proc` so they are useful in those contexts. Examples: ```ruby require 'procer' [1, 2, '3', '4', 5, 6].filter(&Numeric) # => [1, 2, 5, 6] [-10, 100, -2, 3, 20, -33].filter(&(0..50)) # => [3, 20] ``` Also, Hashes already implement `to_proc` and that is useful with Enumerator. We can use it as a transformation table with `map`: ```ruby table = { 1 => 'one', 2 => 'two', 3 => 'three' } [3, 1, 2].map(&table) # => ['three, 'one, 'two'] ``` Sadly, Arrays, even when they have the same interface as hashes as a function of indices, don't implement `to_proc` and so they can't be used in the same way. Until now. ```ruby table = ['zero', 'one', 'two'] [2, 0, 1].map(&table) # => ['two', 'zero', 'one'] ``` Alternatively, you could have used `values_at`: ```ruby table.values_at([3, 1, 2]) # In the Hash example table.values_at([2, 0, 1]) # In the Array example ``` But the map solution is more generic and `table` can be anything that implements `to_proc` and not something that necessarily implements `values_at`. Notice that if the object implements `[]` that will triumph over `===`. It was unexpected when I tried to use Integers as the object, as they implement `[]` as a way to access their binary form: ```ruby 5 # b101 [5[2], 5[1], 5[0]] # [1, 0, 1] ``` So the proc will work like that: ```ruby [2, 4, 5].map(&5) # Actual => [1, 0, 0] # I was expecting => [false, false, true] ```
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.
No description provided.