Skip to content

Instantly share code, notes, and snippets.

View ibraAbuKaff's full-sized avatar

Ibraheem Z. Abu-Kaff ibraAbuKaff

View GitHub Profile
@ibraAbuKaff
ibraAbuKaff / Dockerfile
Created November 20, 2020 10:49 — forked from yefim/Dockerrun.aws.json
Build a Docker image, push it to AWS EC2 Container Registry, then deploy it to AWS Elastic Beanstalk
# Example Dockerfile
FROM hello-world
@ibraAbuKaff
ibraAbuKaff / install-docker.md
Created November 13, 2020 08:42 — 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
text = '3864191019125101291519'
i = 0;
j = i+1
palindroms = []
while i<=len(text):
while(j<= len(text)):
str1 = text[i:j]
reversed_str1 = str1[::-1]
@ibraAbuKaff
ibraAbuKaff / nodejs-cheatsheet.js
Created November 11, 2018 07:09 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
{
"status": 200,
"data": [
{
"img": "test.jpg",
"result": [
{
"type": "sfw",
"label": "Safe for work",
"score": 0.997336208820343
[
{
"country": "UAE",
"city": "Dubai",
"address": "Dubai Mall",
"loc": {
"type": "Point",
"coordinates": [
25.1973,
55.2793
[
{
"country": "UAE",
"city": "Dubai",
"address": "Dubai Mall",
"loc": {
"type": "Point",
"coordinates": [
25.1973,
55.2793
//1- Setup Replica set : @link :https://www.sohamkamani.com/blog/2016/06/30/docker-mongo-replica-set/
//2- the following code:
const { ReplSet } = require('mongodb-topology-manager');
const mongodb = require('mongodb');
run().catch(error => console.error(error));
async function run() {
console.log(new Date(), 'start');
@ibraAbuKaff
ibraAbuKaff / is_installed.sh
Created July 10, 2018 09:52 — forked from JamieMason/is_installed.sh
Check if a program exists from a bash script.Thanks to twitter.com/joshnesbitt and twitter.com/mheap for the help with detecting npm packages.
#!/bin/bash
# Functions ==============================================
# return 1 if global command line program installed, else 0
# example
# echo "node: $(program_is_installed node)"
function program_is_installed {
# set to 1 initially
local return_=1
import React, {Component} from "react";
import axios from "axios";
class IpAddress extends Component {
constructor() {
super();
this.state = {
ip: "",
country: "",