Skip to content

Instantly share code, notes, and snippets.

View KhaledLela's full-sized avatar

Khaled Mohamed KhaledLela

View GitHub Profile
@KhaledLela
KhaledLela / Nginx site example
Created November 8, 2021 10:53
Create nginx site with SSL using script
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name example.site.com;
index index.html index.htm;
root /var/www/sites/app/production;
@KhaledLela
KhaledLela / scripts
Created November 8, 2021 10:50
SedAndAwk.sh
#!/bin/bash
helpFunction()
{
echo ""
echo "Usage: $0 -d DOMAIN -n NAME"
echo "\t-d Root domain"
echo "\t-n Name/subdomain"
exit 1 # Exit script after printing help
}
@KhaledLela
KhaledLela / sh
Created November 8, 2021 10:44
ScriptDefineParamWithHelpFunction
#!/bin/bash
helpFunction()
{
echo ""
echo "Usage: $0 -d DOMAIN -n NAME"
echo "\t-d Root domain"
echo "\t-n Name/subdomain"
exit 1 # Exit script after printing help
}
@KhaledLela
KhaledLela / TryFinallyTest
Last active October 5, 2016 08:50
Try-Finally
public class TryFinallyTest{
private int page;
public static void main(String args[]){
TryFinallyTest instance = new TryFinallyTest();
System.out.print(instance.getPageAndIncrement());
System.out.print(" - ");
System.out.print(instance.getPage());
}
@KhaledLela
KhaledLela / DynamicallyColoredBarChartWithLabel
Last active December 20, 2015 04:29
JavaFx adding a text label on top of StackedBarChart
import javafx.application.Application;
import javafx.beans.value.*;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.geometry.Bounds;
import javafx.geometry.Pos;
import javafx.scene.*;
import javafx.scene.chart.*;
import javafx.scene.control.Label;
import javafx.scene.layout.*;
@KhaledLela
KhaledLela / StackedBarChartSample
Last active December 15, 2015 02:49
StackedBarChart positive and negative bar values.
import java.util.Arrays;
import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.scene.chart.CategoryAxis;
import javafx.scene.chart.NumberAxis;
import javafx.scene.chart.StackedBarChart;
import javafx.scene.chart.XYChart;
import javafx.stage.Stage;
@KhaledLela
KhaledLela / CustomizedStackedBarChart
Created March 18, 2013 20:02
Fix Bug on StackedBarChart to be able to add more that one bar (positive & negative) for each category on each series
/*
* Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*