-n = number of lines to show
-f = follow
-q = quite (don't show file headers)
This file contains 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
<?php | |
// https://codeigniter.com/userguide3/general/creating_libraries.html | |
class EventPublisher { | |
const SOURCE = 'admin' | |
public function __construct($params, $resource_name) | |
{ | |
$this->CI =& get_instance(); |
This file contains 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
# install brew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# zsh | |
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
brew install hub | |
# install brew cask | |
brew tap caskroom/cask |
This file contains 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
// AES RFC - https://tools.ietf.org/html/rfc3602 | |
const crypto = require('crypto'); | |
const algorithm = 'aes-256-cbc'; | |
// generate with crypto.randomBytes(256/8).toString('hex') | |
const key = process.env.AES_KEY; | |
const IV_LENGTH = 16; | |
const encrypt = (text) => { | |
const iv = crypto.randomBytes(IV_LENGTH); |
This file contains 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
const express = require('express'); | |
const { sequelize } = require('../models'); | |
const router = express.Router(); | |
/** | |
* @swagger | |
* /api/health-check: |
aws sns list-topics --query 'Topics[*]' --output text | cut -d ':' -f 6
aws s3 ls | cut -d ' ' -f 3
aws cloudwatch describe-alarms \
--query 'MetricAlarms[*].{arn:AlarmArn, name:AlarmName,threshold:Threshold, statistic:Statistic, state:StateValue}'
This file contains 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
-- $> createdb time_based_differentials | |
-- $> psql time_based_differentials | |
-- Setup Basic Tables | |
CREATE TABLE customers ( | |
id SERIAL UNIQUE NOT NULL, | |
first_name char(30), -- not unique | |
last_name char(30), | |
department char(50), |
This file contains 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
-- $> createdb boolean_test | |
-- $> psql boolean_test | |
CREATE TABLE benchmark_booleans ( | |
id SERIAL UNIQUE NOT NULL, | |
is_deleted boolean, -- not unique | |
deleted_at timestamp | |
); |
This file contains 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
class HiddenOperator(object): | |
def __init__(bucket, prefix, key_filter=None): | |
self.bucket = bucket | |
self.prefix = prefix | |
self.key_filter = key_filter | |
def run(): | |
print("List keys") | |
keys = [ |
This file contains 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
class BaseValidator(object): | |
def validate(rules_definition): | |
errors = [] | |
for rule in rules_definition.rules: | |
response = rule.validate() | |
if response[1]: | |
errors.append(response[1]) | |
if len(errors) > 0 | |
return Cloudwatch |
NewerOlder