Skip to content

Instantly share code, notes, and snippets.

@r-peppa-pig
r-peppa-pig / README.md
Created Jan 25, 2020 — forked from eldondevcg/README.md
Cross account bucket access for IAM roles
View README.md

For: https://www.reddit.com/r/aws/comments/5jf7fb/permissions_for_lambda_accessing_s3_buckets_in/

This is a little tricky, because it requires several different moving parts, specifically,

  • the lambda task that you want to execute the copy must have IAM access to the bucket in the other account. This is not something that was obvious to me to begin with, although my use case was more complicated.
  • the bucket policy on the destination account must be set to permit your lambda function to write to that bucket. For my special use cases, I have to upload a new bucket policy daily to the receiving buckets. Alternatively, the destination accounts could probably give your a cross-account IAM role to upload the bucket policy yourself.
  • You will likely want to write your objects with the bucket-owner-full-control acl, http://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html otherwise, the bucket owner may not be able to download them.
@saeedvir
saeedvir / ApiDataResponse.php
Last active Jan 25, 2020
Standard API Response in PHP
View ApiDataResponse.php
<?php
/**
* Standard API Response in PHP
*
* @author Saeedvir [
* 'email' => 'saeed.es91@gmail.com',
* 'telegram' => 'https://t.me/PhpWebDeveloper'
* ]
*
* @usage :
@HugsLibRecordKeeper
HugsLibRecordKeeper / output_log.txt
Created Jan 25, 2020
Rimworld output log published using HugsLib
View output_log.txt
This file has been truncated, but you can view the full file.
Log uploaded on Saturday, January 25, 2020, 1:56:13 PM
Loaded mods:
Core: (no assemblies)
疯狂技能: 0Harmony(1.2.0.1), MadSkills(0.0.0.0)
0012稳定品质: static_quality_plus(1.0.0.0)
0022精心准备: 0Harmony(1.1.0.0), EdBPrepareCarefully(1.0.10.0)
0024RuntimeGC: RuntimeGC(20.0.15.1)
0065RT武器: (no assemblies)
HugsLib[ov:6.1.1]: 0Harmony(1.2.0.1), HugsLib(av:1.0.0.0,fv:6.1.1)
View abstract_1.dart
// 抽象クラスをインスタンス化はできません。
void main() {
var shape = Shape();
}
abstract class Shape {
double area();
}
@KBiswas98
KBiswas98 / Next slide & start slide & end slide
Created Jan 25, 2020
react-native slider/carousel using scrollView
View Next slide & start slide & end slide
_goToNextPage = () => {
if (
ActivePortionOfScrollView >
Dimensions.get('window').width * (NumberOfSlide - 1)
)
ActivePortionOfScrollView = -Dimensions.get('window').width;
ActivePortionOfScrollView =
ActivePortionOfScrollView +
Dimensions.get('window').width +
View Ubuntu server 18.04 initial user setup
# Add user
adduser ubuntu
# Set to super user
usermod -aG sudo ubuntu
# Switch user
sudo su ubuntu
# Add .ssh to ubuntu user
@faruk09
faruk09 / Sticky menu on scroll
Last active Jan 25, 2020
Sticky menu on scroll
View Sticky menu on scroll
<header>
<div class="logo">OLD, OUTDATED STICKY MENU METHOD</div>
<div class="intro">Our company is crap! Don't buy our stuff!</div>
<div class="menu">Menu goes here - home - links - blah blah</div>
</header>
<div class="content">Main Content Goes here</div>
--------------------------------------------------------------------
.menu-padding {padding-top:40px;}
.sticky {position:fixed; top:0;}
@SparshaD
SparshaD / PY0101EN-5.2_API_2.ipynb
Created Jan 25, 2020
Created on Cognitive Class Labs
View PY0101EN-5.2_API_2.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View gist:0fd9082a8ae6452fa7abbfd264412fdc
const info = require('util').debuglog('INFO')
const warn = require('util').debuglog('WARN')
info('hello %s %d', 'lambda', 1) // INFO 244: hello lambda 1
warn('hello %s %d', 'lambda', 1) // WARN 244: hello lambda 1
You can’t perform that action at this time.