Skip to content

Instantly share code, notes, and snippets.

View omar-dulaimi's full-sized avatar
🎩
Top hat

Omar Dulaimi omar-dulaimi

🎩
Top hat
  • Jordan
View GitHub Profile
@omar-dulaimi
omar-dulaimi / serverless-with-trust-policy-change.yml
Created April 7, 2021 19:13 — forked from sdomagala/serverless-with-trust-policy-change.yml
Change Trust Policy in Serverless IAM Role (or any other params other than policy)
## all other serverless.yml configuration
functions:
# your functions
provider:
name: aws
# your provider config
resources:
Resources:
@omar-dulaimi
omar-dulaimi / shallow-routing-snippet
Last active July 15, 2020 06:50
Shallow routing Nextjs, undocumented case
this.props.router.push(
`/search?type=${this.state.type}&cat=${this.state.cat}&area=${this.state.area.name}&page=${currentQuery.page}&aid=${this.state.area.id}`,
`/search/${this.state.type}/${this.state.cat}/${this.state.area.name}?page=${currentQuery.page}&aid=${this.state.area.id}`,
{ shallow: true }
);
export default withRouter(connect(mapStateToProps)(SearchPage));
might also need this on your custom server:
@omar-dulaimi
omar-dulaimi / command.txt
Created May 27, 2020 21:13
Fix Docker client version 1.40 is too new. Maximum supported API version is 1.39 [UBUNTU]
apt-get install -y --allow-downgrades docker-ce-cli=5:19.03.8~3-0~ubuntu-$(lsb_release -cs)
@omar-dulaimi
omar-dulaimi / react-app-s3-sync.sh
Created May 17, 2020 15:44 — forked from kevindice/react-app-s3-sync.sh
A shell script for uploading a React app build to S3 + CloudFront for deployment
#!/bin/bash
S3_BUCKET_NAME=$1
CF_ID=$2
# Sync all files except for service-worker and index
echo "Uploading files to $S3_BUCKET_NAME..."
aws s3 sync build s3://$S3_BUCKET_NAME/ \
--acl public-read \
--exclude service-worker.js \
@omar-dulaimi
omar-dulaimi / expression_form_not_supported
Created September 29, 2019 06:38
Angular Expression form not supported
Solution:
Got this problem.
Added // @dynamic before the class that declares static method:
// @dynamic
export class SomeClass {
public static get() { return 'someValue'; }
}
I believe that static methods within classes are used ie for "MyModule.forRoot()", and angular thinks you are defining a module. As your function would not be compatible with AOT, it compilation fails, and the // @dynamic directive is like "don't worry Angular, this class is not intented to be used for bootstapping some modules."
@omar-dulaimi
omar-dulaimi / docker-help.md
Created July 20, 2019 16:49 — forked from bradtraversy/docker-help.md
Docker Commands, Help & Tips

Docker Commands, Help & Tips

Show commands & management commands

$ docker

Docker version info