Skip to content

Instantly share code, notes, and snippets.

View mamounothman's full-sized avatar

Ma'moun othman mamounothman

View GitHub Profile
@mamounothman
mamounothman / index.html
Created February 4, 2019 12:29 — forked from benjchristensen/index.html
Animated Line Graphs / Sparklines using SVG Path and d3.js
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@mamounothman
mamounothman / index.html
Created February 4, 2019 12:28 — forked from benjchristensen/index.html
Animated Sparkline using SVG Path and d3.js
<html>
<head>
<title>Animated Sparkline using SVG Path and d3.js</title>
<script src="http://mbostock.github.com/d3/d3.v2.js"></script>
<style>
/* tell the SVG path to be a thin blue line without any area fill */
path {
stroke: steelblue;
stroke-width: 1;
fill: none;
@mamounothman
mamounothman / index.html
Created February 4, 2019 12:27 — forked from benjchristensen/index.html
Interactive Line Graph (D3)
<!--
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@mamounothman
mamounothman / socket.io-stream-server-to-browser.js
Created August 6, 2018 18:21 — forked from companje/socket.io-stream-server-to-browser.js
socket.io-stream from NodeJS Server to Browser
/////////////////////////////
// NodeJS Server
/////////////////////////////
var express = require('express');
var app = express();
var http = require('http').Server(app);
var io = require('socket.io')(http);
var ss = require('socket.io-stream');
var path = require('path');
@mamounothman
mamounothman / jwtRS256.sh
Created July 3, 2018 08:38 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@mamounothman
mamounothman / Makefile
Created May 20, 2018 11:09 — forked from mpneuried/Makefile
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@mamounothman
mamounothman / README.md
Created May 1, 2018 08:26 — forked from mbostock/README.md
Quadtree

This example demonstrates accelerated two-dimensional filtering enabled by d3-quadtree. A quadtree recursively subdivides square cells into four equal-sized subcells. Each leaf node of the quadtree contains a single point. If a given quadtree cell does not intersect the brush extent, then none of the points contained in that subtree can be selected, and thus do not need to be scanned. Above, orange indicates points that are scanned but not selected. Without a quadtree, all points would need to be scanned!

@mamounothman
mamounothman / index.html
Created April 24, 2018 20:23 — forked from sconnelley/index.html
Fitting D3 map inside a viewport and constrain panning.
<!DOCTYPE html>
<html lang="en">
<head>
<title>d3 geo map</title>
<meta charset="utf-8">
<style>
svg {
border: 1px solid #ccc;
}
@mamounothman
mamounothman / nginxproxy.md
Created April 23, 2018 13:58 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

@mamounothman
mamounothman / upgrade-postgres-9.6-to-10.md
Created April 22, 2018 12:54 — forked from mdesantis/upgrade-postgres-9.6-to-10.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main