Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Khaled Sameer KhaledSMQ

🎯
Focusing
Block or report user

Report or block KhaledSMQ

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@KhaledSMQ
KhaledSMQ / worker.js
Created Jul 24, 2019 — 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.
View worker.js
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 Jan 13, 2019 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
View introrx.md
View sanfrancisco-font.css
/** 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 Jul 13, 2018 — forked from remojansen/class_decorator.ts
TypeScript Decorators Examples
View class_decorator.ts
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 — forked from yosukehasumi/readme.md
DigitalOcean Rails/Ubuntu/NGINX (16.04) Setup
View readme.md

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 Apr 27, 2018 — forked from tbranyen/_usage.md
OpenWeatherMap / Weather Icons integration
View _usage.md
  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=?');
View SimpleHTTPServer.cs
// 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;
View install-opencv-2.4.13-in-ubuntu.sh
# 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 Apr 7, 2017 — forked from NickBranstein/config.xml
log4net properties config
View config.xml
<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" />
@KhaledSMQ
KhaledSMQ / gist:53b7f5a5f52d6e9af48e242c2a3a8771
Created Apr 7, 2017 — forked from Dillie-O/gist:4170626
Log4Net Basic TextAppender and SQLite Appender configuration
View gist:53b7f5a5f52d6e9af48e242c2a3a8771
<?xml version="1.0" encoding="utf-8"?>
<log4net debug="false">
<appender name="file-appender" type="log4net.Appender.FileAppender+MinimalLock">
<file value="log-file.txt" />
<appendToFile value="true" />
<lockingModel type="log4net.Appender.FileAppender+MinimalLock" />
<layout type="log4net.Layout.PatternLayout">
<conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
</layout>
</appender>
You can’t perform that action at this time.