Skip to content

Instantly share code, notes, and snippets.


Mohamed Mansour mohamedmansour

Block or report user

Report or block mohamedmansour

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

Keybase proof

I hereby claim:

  • I am mohamedmansour on github.
  • I am mohamedmansour ( on keybase.
  • I have a public key ASDXVqA3srRPgG6gYwdTRJjC-OxoALXBRroXqf-r4bO2nAo

To claim this, I am signing this object:

mohamedmansour / launch.json
Created Oct 24, 2018
webpack-dev-server integration with vscode and typescript for react
View launch.json
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
"version": "0.2.0",
"configurations": [
"type": "chrome",
"request": "launch",
"name": "Debug",
View crawler.js
const cheerio = require('cheerio')
const request = require('request')
const { URL } = require('url')
const async = require('async')
var links = {}
fetchAllLinks('', links, () => {
let listLinks = Object.keys(links).map(link => {return `"${link}"`})
console.log(`[\n ${listLinks.join(',\n ')}\n ]`)
mohamedmansour / alexa-node.js
Created Feb 18, 2017
Hackathon - Amazon Alexa Backend using Lambda
View alexa-node.js
var http = require('http');
exports.handler = function (event, context) {
try {
console.log("event.session.application.applicationId=" + event.session.application.applicationId);
if ( {
onSessionStarted({requestId: event.request.requestId}, event.session);
View BundlerHtmlHelper.cs
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Microsoft.AspNetCore.Html;
using Newtonsoft.Json;
namespace HtmlHelpers
/// <summary>
View gist:6c8d4e342f9c791d8d55
task<GeolocationAccessStatus> geolocationAccessRequestTask(Windows::Devices::Geolocation::Geolocator::RequestAccessAsync());
geolocationAccessRequestTask.then([this](task<GeolocationAccessStatus> accessStatusTask)
// Get will throw an exception if the task was canceled or failed with an error
auto accessStatus = accessStatusTask.get();
if (accessStatus == GeolocationAccessStatus::Allowed)
// LOG: Waiting for update...
auto geolocator = ref new Windows::Devices::Geolocation::Geolocator();
View gist:33802d10fcf218e28fc6
// In jQuery the easy thing to do when to decruft json responses if a javascript has:
// for (;;); {foo: 'bar'}
// Is to decruft it using ajax converters. Example
converters: {
"text json": function(result) {
return JSON.parse(result.replace('for (;;);', ''));
mohamedmansour / Animation.xaml
Created Jul 3, 2014
Pulse Animation in XAML
View Animation.xaml
<Storyboard x:Name="StartAnimation">
<DoubleAnimation RepeatBehavior="Forever" Duration="0:0:1" To="360" Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.Rotation)" Storyboard.TargetName="ProgressArc"/>
<DoubleAnimation Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" From="25" To="35" Storyboard.TargetName="IndicatorRing" Storyboard.TargetProperty="StrokeThickness"/>
<DoubleAnimation Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" From="350" To="370" Storyboard.TargetName="IndicatorRing" Storyboard.TargetProperty="Height"/>
<DoubleAnimation Duration="0:0:0.5" RepeatBehavior="Forever" AutoReverse="True" From="350" To="370" Storyboard.TargetName="IndicatorRing" Storyboard.TargetProperty="Width"/>
mohamedmansour / gist:dc0c56820015e7f700e9
Last active Aug 29, 2015
Basic Cross Sandbox Communication for iOS 8 Action Extensions
View gist:dc0c56820015e7f700e9
// Append the transfer dom to the document.
var transferDOM = document.createElement('div'); = 'none'; = 'transferdom';
function injectScript(fn) {
var script = document.createElement('script');
script.appendChild(document.createTextNode('(' + fn + ')();'));
mohamedmansour / Popup.xaml
Created May 10, 2014
Example of a popup control in Xaml with nice triangle
View Popup.xaml
<Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,55,0,0">
<Grid Background="White" Margin="0,10,0,0">
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<StackPanel Grid.Row="0" Margin="20" Background="Transparent">
<TextBlock Text="Listening" FontSize="36" Margin="0"/>
<StackPanel Grid.Row="1" Margin="20" Background="Transparent" VerticalAlignment="Bottom">
You can’t perform that action at this time.