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 / 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

@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 / 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 / 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 / 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 / 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 / paramDecorator.ts
Created April 11, 2021 15:52
TypeGraphQL with PrismaSelect from Pal.js
import { PrismaSelect } from '@paljs/plugins';
export function Fields(): ParameterDecorator {
return createParamDecorator(({ info }) => {
const fieldsMap = new PrismaSelect(info).value;
return fieldsMap;
});
}
@omar-dulaimi
omar-dulaimi / log.txt
Created May 5, 2021 20:46
k6 panic error
This file has been truncated, but you can view the full file.
/\ |‾‾| /‾‾/ /‾‾/
/\ / \ | |/ / / /
/ \/ \ | ( / ‾‾\
/ \ | |\ \ | (‾) |
/ __________ \ |__| \__\ \_____/ .io
execution: local
script: loadtest.js
output: -
@omar-dulaimi
omar-dulaimi / install-docker.md
Created May 19, 2021 06:19 — forked from npearce/install-docker.md
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@omar-dulaimi
omar-dulaimi / linkedin_boolean_search.txt
Last active March 12, 2022 08:35
Nodejs developer LinkedIn Boolean Search Query
(node OR nodejs OR "node js" OR "Node.js" OR nestjs OR expressjs) AND (remote OR remotely) NOT (ruby OR php OR go OR rust OR asp OR asp.net OR c# OR rails OR Selenium OR WebDriver OR "Java" OR "java" OR CyberCoders OR Revelo OR 10Clouds OR Manara)