Skip to content

Instantly share code, notes, and snippets.

View KhaledSMQ's full-sized avatar
🎯
Focusing

Khaled Sameer KhaledSMQ

🎯
Focusing
View GitHub Profile
@KhaledSMQ
KhaledSMQ / redis-docker-for-mac.md
Created March 23, 2021 00:12 — forked from simonw/redis-docker-for-mac.md
How to run a redis server using Docker-for-Mac

How to run a redis server using Docker-for-Mac

This will work with other flavours of Docker as well.

Run the following command:

docker run --name my-redis -p 6379:6379 --restart always --detach redis

This will download and run redis, set to auto-restart when your machine starts and bound to port 6379 on your machine.

@KhaledSMQ
KhaledSMQ / worker.js
Created July 24, 2019 17:12 — forked from jthomas/worker.js
Using IBM Cloud Edge Functions (Cloudflare Workers) to add support for Index and Error documents for Cloud Object Storage static hosting.
const INDEX_DOCUMENT = 'index.html'
const ERROR_DOCUMENT = '404.html'
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* @param {Request} request
*/
@KhaledSMQ
KhaledSMQ / introrx.md
Created January 13, 2019 06:07 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@KhaledSMQ
KhaledSMQ / sanfrancisco-font.css
Created July 25, 2018 19:18
San Francisco Web Font
/** WARNING - USE AT OWN RISK */
/** IT IS AGAINST APPLE'S POLICY TO USE SF PRO FOR ANYTHING OTHER THAN iOS/tvOS/macOS/watchOS DESIGN & DEVELOPMENT */
/** https://sf.abarba.me/LICENSE.pdf */
/** 1. Copy/import this file into your main css/scss file */
/** 2. Change css font-family: to "SF Text", "SF Display" or "SF Mono" */
/** 3. Apply font-weight or italic to html elements */
/** THANK YOU */
/** I host these fonts on Cloudfront with SSL in all AWS regions for the best performance and reliability */
@KhaledSMQ
KhaledSMQ / class_decorator.ts
Created July 13, 2018 16:19 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
function logClass(target: any) {
// save a reference to the original constructor
var original = target;
// a utility function to generate instances of a class
function construct(constructor, args) {
var c : any = function () {
return constructor.apply(this, args);
}
@KhaledSMQ
KhaledSMQ / readme.md
Created May 26, 2018 00:55 — forked from yosukehasumi/readme.md
DigitalOcean Rails/Ubuntu/NGINX (16.04) Setup

DigitalOcean Rails/Ubuntu/NGINX (16.04) Setup

  1. Setup
  2. Swapfile
  3. NGINX
  4. ElasticSearch
  5. RVM
  6. Rails
  7. Postgres
  8. Capistrano
@KhaledSMQ
KhaledSMQ / _usage.md
Created April 27, 2018 10:25 — forked from tbranyen/_usage.md
OpenWeatherMap / Weather Icons integration
  1. Include Weather Icons in your app: https://github.com/erikflowers/weather-icons

  2. Include the below JSON in your application, for example purposes, lets assume it's a global named weatherIcons.

  3. Make a request to OpenWeatherMap:

req = $.getJSON('http://api.openweathermap.org/data/2.5/weather?q=London,uk&callback=?');
@KhaledSMQ
KhaledSMQ / SimpleHTTPServer.cs
Created December 25, 2017 09:35 — forked from aksakalli/SimpleHTTPServer.cs
SimpleHTTPServer in C#
// MIT License - Copyright (c) 2016 Can Güney Aksakalli
// https://aksakalli.github.io/2014/02/24/simple-http-server-with-csparp.html
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net.Sockets;
using System.Net;
using System.IO;
@KhaledSMQ
KhaledSMQ / install-opencv-2.4.13-in-ubuntu.sh
Created July 18, 2017 20:15 — forked from arthurbeggs/install_opencv2_ubuntu.sh
Install opencv-2.4.13 in Ubuntu 16.04
# install dependencies
sudo apt-get update
sudo apt-get install -y build-essential
sudo apt-get install -y cmake
sudo apt-get install -y libgtk2.0-dev
sudo apt-get install -y pkg-config
sudo apt-get install -y python-numpy python-dev
sudo apt-get install -y libavcodec-dev libavformat-dev libswscale-dev
sudo apt-get install -y libjpeg-dev libpng12-dev libtiff5-dev libjasper-dev
@KhaledSMQ
KhaledSMQ / config.xml
Created April 7, 2017 10:41 — forked from NickBranstein/config.xml
log4net properties config
<log4net>
<appender name="AdoNetAppender" type="log4net.Appender.AdoNetAppender">
<bufferSize value="1" />
<connectionType value="System.Data.SqlClient.SqlConnection, System.Data, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<connectionStringName value="ConnectionName" />
<commandText value="INSERT INTO dbo.tbl_Log4Net_Log ([Date],[User],[Application],[Thread],[Ndc],[Level],[Logger],[Message],[Exception]) VALUES (@log_date, @user, @application, @thread, @ndc, @log_level, @logger, @message, @exception)" />
<parameter>
<parameterName value="@log_date" />
<dbType value="DateTime" />
<layout type="log4net.Layout.RawTimeStampLayout" />