Skip to content

Instantly share code, notes, and snippets.

View fatmali's full-sized avatar
:octocat:
Coding away

Fatma Ali fatmali

:octocat:
Coding away
View GitHub Profile
@fatmali
fatmali / merge-sort.ts
Last active February 2, 2021 17:14
Merge Sort in TypeScript
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 April 2, 2019 07:57
Heartbeat 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 April 2, 2019 07:36
Heartbeat Monitors
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 April 2, 2019 07:00
ELK Docker Compose with Heartbeat
...
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 January 27, 2019 11:53
A logstash config file for ingesting data from MySQL table into Elasticsearch
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 August 5, 2018 12:04
Python SHA1 Generator
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 August 5, 2018 11:36
Pyspark Jupyter Docker Compose
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 January 14, 2018 09:38 — forked from PurpleBooth/README-Template.md
A template to make good README.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

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