Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:
Coding away

Fatma Ali fatmali

:octocat:
Coding away
View GitHub Profile
@fatmali
fatmali / merge-sort.ts
Last active Feb 2, 2021
Merge Sort in TypeScript
View merge-sort.ts
function mergeSort(A: number[]): void {
const n = A.length;
if (n < 2) {
return A;
}
const mid = Math.floor(n / 2);
const left = A.slice(0, mid);
const right = A.slice(mid);
mergeSort(left);
mergeSort(right);
@fatmali
fatmali / Dockerfile
Last active Apr 2, 2019
Heartbeat Dockerfile
View Dockerfile
ARG ELK_VERSION
FROM docker.elastic.co/beats/heartbeat:${ELK_VERSION}
# Auto-Create Kibana Heartbeat Dashboard Tables
RUN /usr/share/heartbeat/heartbeat setup --dashboards
@fatmali
fatmali / heartbeat.yml
Last active Apr 2, 2019
Heartbeat Monitors
View heartbeat.yml
heartbeat.monitors:
- type: http
schedule: '@every 10s'
urls:
- https://fatmali@github.io
- https://google.com
check.request:
method: GET
headers:
@fatmali
fatmali / elk-docker-compose.yml
Last active Apr 2, 2019
ELK Docker Compose with Heartbeat
View elk-docker-compose.yml
...
heartbeat:
build:
context: ./heartbeat
args:
ELK_VERSION: $ELK_VERSION
volumes:
- ./heartbeat/config/heartbeat.yml:/usr/share/heartbeat/heartbeat.yml:ro
environment:
@fatmali
fatmali / logstash.conf
Created Jan 27, 2019
A logstash config file for ingesting data from MySQL table into Elasticsearch
View logstash.conf
input {
jdbc {
jdbc_connection_string => "jdbc:mysql://localhost:3306/testdb"
# The user we wish to execute our statement as
jdbc_user => "root"
jdbc_password => "123456"
# The path to our downloaded jdbc driver
jdbc_driver_library => "/home/comp/Downloads/mysql-connector-java-5.1.38.jar"
jdbc_driver_class => "com.mysql.jdbc.Driver"
# our query
@fatmali
fatmali / sha1_generator.py
Last active Aug 5, 2018
Python SHA1 Generator
View sha1_generator.py
import hashlib
# for python version 2.7 use raw_input instead
my_pass = input('Enter Password to hash: ')
sha1_obj = hashlib.sha1(bytes(my_pass))
sha1_hex = sha1_obj.hexdigest()
print("Your SHA1 Password is " + sha1_hex)
@fatmali
fatmali / docker-compose.yml
Last active Aug 5, 2018
Pyspark Jupyter Docker Compose
View docker-compose.yml
version: '2'
services:
spark-jupyter:
image: jupyter/pyspark-notebook
command: /usr/local/bin/start-notebook.sh --NotebookApp.password='sha1:YOUR_HASHED_PASSWORD'
ports:
- 4040:4040
- 8060:8080
- 8888:8888
- 10000:10000
@fatmali
fatmali / README-Template.md
Created Jan 14, 2018 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

View client.ts
import { Singleton } from './singleton.ts';
class Client {
singletonInstance = Singleton.getInstance();
singletonInstance.log("It's the same object dummy");
}
View singleton.ts
namespace Singleton {
export function log(message: string) {
console.log('Log:' + message);
}
}