Skip to content

Instantly share code, notes, and snippets.

View rousan's full-sized avatar
:shipit:
Building products

Rousan Ali rousan

:shipit:
Building products
View GitHub Profile
@rousan
rousan / test.cpp
Created May 29, 2017 15:13
Solution of that two questions
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdlib>
#include <unordered_map>
using namespace std;
void findSomePair(int* arr, int arrSize, int sum, int* pairElementIndex1, int* pairElementIndex2);
void testFindSomePair();
void reverse(char* arr, int start, int end);
@rousan
rousan / solutions.js
Created May 29, 2017 16:45
Solution in JS
function findSomePair(arr, sum) {
arr = arr || [];
sum = sum || 0;
let outs = {},
map = new Map();
if (arr.length <= 1) {
outs["pairElementIndex1"] = -1;
@rousan
rousan / README.md
Last active November 10, 2017 06:37
Interactive Charts using Vue-FusionCharts wrapper

VueJS is a progressive JavaScript framework for building user interfaces and FusionCharts provides a VueJS binding, so we can use this binding to render our interactive charts.

Including Interactivity Between Charts

Assume that you have a dashboard with a pie 2D and a column 2D chart to plot sales data for Harry’s retail and wholesale stores. The pie 2D chart plots collective sales for the retail and wholesale stores; the column 2D chart plots sales for individual stores. Harry wants his charts to be interactive in a way that when the Retail pie slice is clicked, the column 2D chart shows data for only all retail stores, and likewise for the wholesale stores.

The dashboard looks as shown below:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@rousan
rousan / WebViewBridge.js
Created December 18, 2017 14:30 — forked from blankg/WebViewBridge.js
Provides a sample implementation for sending and receiving messages to and from the React-Native WebView (using postMessage/onMessage WebView API).
/**
* Created by Guy Blank on 3/9/17.
*
* This is a sample provides an API to send & receive messages to and from the React-Native WebView (using postMessage/onMessage WebView API).
*
* webViewBridge.send('functionToInvoke', {mydata: 'test'}, function(){console.log('success')},function(){console.log('error')});
*
* The API is designed to be similar to the Cordova exec API so migration to it should be almost seamless.
* The API also provides solution to a React-Native WebView bug in iOS which causes sending consecutive postMessage calls to override each other.
*
@rousan
rousan / Dockerfile
Created January 5, 2018 07:20 — forked from thom-nic/Dockerfile
Dockerfile that attempts to run the app as non-root user. This creates a `node` user & sets permissions on app files. Note you cannot `chown` files in a docker 'volume' during the build process, but you can at runtime (as part of your `CMD`) but in that case you can't use the `USER` command to change the UID before `CMD` runs.
###
# Node.js app Docker file
#
# Some basic build instructions:
# ```
# # you should delete node_modules b/c you don't want that copied during 'ADD'
# docker build -t thom-nic/node-bootstrap .
# # run a shell in the container to inspect the environment (as root):
# docker run --rm -itu root thom-nic/node-bootstrap /bin/bash
# ```
//
// Regular Expression for URL validation
//
// Author: Diego Perini
// Updated: 2010/12/05
// License: MIT
//
// Copyright (c) 2010-2013 Diego Perini (http://www.iport.it)
//
// Permission is hereby granted, free of charge, to any person
@rousan
rousan / FusionCharts country codes: Format->1
Last active January 22, 2018 14:12 — forked from soumyasankarduttagit/FusionCharts country codes
Mapping of FusionCharts country name and country codes.
{
"antigua and barbuda": "01",
"bahamas": "02",
"barbados": "03",
"belize": "04",
"canada": "05",
"costa rica": "06",
"cuba": "07",
"dominica": "08",
"dominican republic": "09",
@rousan
rousan / HOWTO.md
Created January 23, 2018 14:39 — forked from cvan/HOWTO.md
How to serve a custom HTTPS domain on GitHub Pages with CloudFlare: *FREE*, secure and performant by default

Instructions

CloudFlare is an awesome reverse cache proxy and CDN that provides DNS, free HTTPS (TLS) support, best-in-class performance settings (gzip, SDCH, HTTP/2, sane Cache-Control and E-Tag headers, etc.), minification, etc.

  1. Make sure you have registered a domain name.
  2. Sign up for CloudFlare and create an account for your domain.
  3. In your domain registrar's admin panel, point the nameservers to CloudFlare's (refer to this awesome list of links for instructions for various registrars).
  4. From the CloudFlare settings for that domain, enable HTTPS/SSL and set up a Page Rule to force HTTPS redirects. (If you want to get fancy, you can also enable automatic minification for text-based assets [HTML/CSS/JS/SVG/etc.], which is a pretty cool feature if you don't want already have a build step for minification.)
  5. If you
@rousan
rousan / gist:0c5d4d079b0c5ee2c51d8777bc173093
Created January 27, 2018 18:45 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue: