Skip to content

Instantly share code, notes, and snippets.

@skierkowski
skierkowski / require-function-description.js
Created January 29, 2019 00:07
Serverless Framework Enterprise Safeguard Policies
const { fromPairs } = require('lodash')
module.exports = function requireFunctionDescription(policy, service, options) {
const {
declaration: { functions },
provider: { naming },
compiled: {
'cloudformation-template-update-stack.json': { Resources }
}
} = service
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Usage: $0 <path_to_content_directory> <organization>/<workspace>"
exit 0
fi
CONTENT_DIRECTORY=$1
ORG_NAME="$(cut -d'/' -f1 <<<"$2")"
WORKSPACE_NAME="$(cut -d'/' -f2 <<<"$2")"
import "tfplan"
main = rule {
all tfplan.resources.aws_instance as _, instances {
all instances as _, r {
r.applied contains "tags" and
r.applied.tags contains "billing-id"
}
}
}
$LOAD_PATH.unshift(File.expand_path("./lib"))
require 'terraform_enterprise_api'
require 'awesome_print'
require 'securerandom'
@client = TerraformEnterprise::Client.new(api_key: ENV['TERRAFORM_ENTERPRISE_TOKEN'])
def test_policy_crud(organization:'000-test-suite',policy_name:"policy-#{SecureRandom.hex(3)}")
{
"swagger" : "2.0",
"info" : {
"version" : "2.0.0",
"title" : "JSON API TFE"
},
"basePath" : "/api/v2",
"tags" : [ {
"name" : "Apply"
}, {

Keybase proof

I hereby claim:

  • I am skierkowski on github.
  • I am skierkowski (https://keybase.io/skierkowski) on keybase.
  • I have a public key ASAROjnLSeI3El9zelPw-iMcxQh1kcB7iVeQf5W3I67zXwo

To claim this, I am signing this object:

My React Native Practices

This isn't so much "Best" practices, but rather "My" practices I try to follow.

Build & Deploy

  • Setup CodePush to deploy the app
  • Use Fastlane to build the project and deploy as-needed
  • Use BitRise as CI as CI service, it has great mobile support
  • I'm Working on creating RN-specific actions for Fastlane

Structure & Syntax

  • fastlane-rnpm: React Native Package Manager support in Fastlane so I can install dependencies in build Fastlane.
  • fastlane-react-native: Fastlane Action(s) for React Native, so I can rebuild my static assets in my build process.
  • fastlane-codepush: Fastlane Action(s) for CodePush, so I can deploy the static assets generated by RN to CodePush.
  • A simple way to detect whether I modified only the static assets or the iOS/Android libraries to determine if I need to rebuild and redistribute, or if I can just use CodePush to deploy the static assets.
@skierkowski
skierkowski / key.pub
Created May 12, 2015 07:44
My public key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCBl89ee71E/WsGtSOJE3WmIAIrD+mNEtnVqZjrxyZs0zjk6NCt9u44TaIC+9dlTt65Nco/BUcZsA6pIrZUgy1WY4qYzEPOsLttwh6z9a9sovrCbo2oA9RkaYsdRdvdskMR+KMvx+WdzeWnWMbJiZo9gG5Fcv3hVVmdQQpFKIthNN077VXVps6AUIv8TeAjcDABtsSAs8gPFgdUnTrckQPQ5rSH13qh+qUFAStAb6s7MZRRJIu/3IOeWdVAkHvCP/ocy/yUFn0ewBd/keXg8936m1Vq17J/dwpVXuUhnwQvoLumNVnCEyGhcKi5Da0/ImEFMpUcd/2Kme+jwwzvO6r
@skierkowski
skierkowski / grape.rb
Created May 1, 2015 22:39
A demo of Grape route_params
require 'grape'
class API < Grape::API
resource :foo do
post do
{done:'done'}
end
route_param :id do