DEBUG FLUSHALL
Resets all queues, jobs
MONITOR
Works like its Redis counterpart
| const path = require('path') | |
| const slsw = require('serverless-webpack') | |
| const { StatsWriterPlugin } = require('webpack-stats-plugin') | |
| const yaml = require('js-yaml') | |
| const fs = require('fs') | |
| require('events').EventEmitter.defaultMaxListeners = 20 // default: 10, using 11 at the moment | |
| /** | |
| * slsw.lib.entries is used when invoking webpack from serverless, e.g. `serverless package` |
| $ CREATE FUNCTION sanitize_dates() RETURNS TRIGGER AS $$ | |
| BEGIN | |
| IF TG_OP = 'INSERT' THEN | |
| NEW.created_on := now(); | |
| NEW.last_modified := NULL; | |
| ELSIF TG_OP = 'UPDATE' THEN | |
| NEW.created_on := OLD.created_on; | |
| NEW.last_modified := now(); | |
| END IF; | |
| RETURN NEW; |
| # Helper script providing `ykaws-auth <profile>` and `ykaws-login <profile>` helpers | |
| # | |
| # Initial Yubikey setup: | |
| # - Install and configure Yubico Authenticator, ykman, AWS Vault | |
| # - Configure your AWS MFA device to be stored in your Yubikey | |
| # - Set a YKAWS_PROFILE environment variable to the TOTP profile name (list with `ykman oath list`) in your shell startup scripts | |
| # - You'll know you're ready when `ykman oath code --single "$YKAWS_PROFILE"` returns an MFA code | |
| # | |
| # Installing this helper: | |
| # - Put it somewhere |
| import com.amazonaws.auth.{ AWSCredentials, AWSCredentialsProvider } | |
| import com.amazonaws.auth.profile.internal._ | |
| import com.amazonaws.auth.profile.internal.securitytoken.STSProfileCredentialsServiceLoader | |
| import com.amazonaws.profile.path.AwsProfileFileLocationProvider | |
| import scala.collection.JavaConverters._ | |
| object AWSAssumedRoleCredentialsProvider { | |
| lazy private val profileName = AwsProfileNameLoader.INSTANCE.loadProfileName() |
| package foo.bar | |
| import java.sql.{ Array => _, _ } | |
| import com.typesafe.config.{ Config, ConfigFactory } | |
| import slick.jdbc.{ JdbcBackend, JdbcDataSource } | |
| import slick.util.ConfigExtensionMethods._ | |
| import slick.util.{ AsyncExecutor, ClassLoaderUtil } | |
| trait CustomExecutorJdbcBackend extends JdbcBackend { |
| <?php | |
| namespace Foobar\Bugsnag; | |
| use Bugsnag\Client; | |
| class OomSnag | |
| { | |
| private const REGEX = '/^Allowed memory size of ([0-9]+) bytes exhausted/'; |
| <?php | |
| namespace MyApp\Test; | |
| use Knp\Console\ConsoleEvent; | |
| use Knp\Console\ConsoleEvents; | |
| use Silex\Application; | |
| use Knp\Console\Application as ConsoleApplication; | |
| use Symfony\Component\Console\Input\StringInput; | |
| use Symfony\Component\Console\Output\BufferedOutput; |
| <?php | |
| require_once __DIR__ . '/vendor/autoload.php'; | |
| use RedBeanPHP\Facade as R; | |
| // Start setup | |
| R::setup(getenv('REDBEAN_DSN'), getenv('REDBEAN_USERNAME'), getenv('REDBEAN_PASSWORD')); | |
| R::exec('DROP TABLE child'); |
| #!/bin/bash | |
| set -e | |
| set -o pipefail | |
| if [ $EUID -ne 0 ]; then | |
| exec sudo "$0" "$@" | |
| fi | |
| readonly hostname=$1 |