Skip to content

Instantly share code, notes, and snippets.

View mdabbagh88's full-sized avatar

Mohammed Eldabbagh mdabbagh88

  • Istanbul, Turkey
View GitHub Profile
@mdabbagh88
mdabbagh88 / MobxRnnProvider.js
Created February 20, 2018 14:12 — forked from megahertz/MobxRnnProvider.js
This is a provider which allows to use mobx-react Provider with wix/react-native-navigation.
import { Provider } from 'mobx-react/native';
const SPECIAL_REACT_KEYS = { children: true, key: true, ref: true };
export default class MobxRnnProvider extends Provider {
props: {
store: Object
};
context: {
@mdabbagh88
mdabbagh88 / riot-matrix-workshop.md
Created February 11, 2018 13:47 — forked from attacus/riot-matrix-workshop.md
Create your own encrypted chat server with Riot and Matrix

Running your own encrypted chat service with Matrix and Riot

Workshop Instructor:

This workshop is distributed under a CC BY-SA 4.0 license.

What are we doing here?

The goal of this workshop is to teach you how to configure and run your own Matrix/Riot service. By the end of the workshop, you should be able to log into secure chat rooms and invite others to the same server.

@mdabbagh88
mdabbagh88 / node-npm-install.md
Created October 31, 2017 17:21 — forked from rcugut/node-npm-install.md
Install node & npm on Mac OS X with Homebrew

Fixing npm On Mac OS X for Homebrew Users

Installing node through Homebrew can cause problems with npm for globally installed packages. To fix it quickly, use the solution below. An explanation is also included at the end of this document.

Solution

This solution fixes the error caused by trying to run npm update npm -g. Once you're finished, you also won't need to use sudo to install npm modules globally.

Before you start, make a note of any globally installed npm packages. These instructions will have you remove all of those packages. After you're finished you'll need to re-install them.

@mdabbagh88
mdabbagh88 / gist:23a97701ab95aabfd6288ac26d09a16d
Created April 12, 2017 00:47 — forked from laullon/gist:1712104
Badge number on a UIButton using MKNumberBadgeView
################################
### UIButton+BPBadgeButton.h ###
################################
#import <UIKit/UIKit.h>
@interface UIButton (BPBadgeButton)
@property (nonatomic) NSUInteger badge;
@end
@mdabbagh88
mdabbagh88 / gist:e40bcc8a85e0178ad03585f25c98e64b
Created March 2, 2017 00:30 — forked from katowulf/gist:4741111
Firebase security rules for a simple chat room model
{
"chat": {
// the list of chats may not be listed (no .read permissions here)
// a chat conversation
"$key": {
// if the chat hasn't been created yet, we allow read so there is a way
// to check this and create it; if it already exists, then authenticated
// user (specified by auth.id) must be in $key/users
@mdabbagh88
mdabbagh88 / wkhtmltopdf-install.md
Created February 17, 2017 16:06 — forked from calebbrewer/wkhtmltopdf-install.md
How to Setup wkhtmltopdf on CentOS 7

How to Setup wkhtmltopdf on CentOS 7

Install Dependencies

yum install fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo

Install wkhtmltopdf

@mdabbagh88
mdabbagh88 / percona-server.rb
Created January 28, 2017 15:36 — forked from jmazzi/percona-server.rb
Percona 5.5 OS X
require 'formula'
class PerconaServer < Formula
url 'http://www.percona.com/redir/downloads/Percona-Server-5.5/Percona-Server-5.5.15-21.0/source/Percona-Server-5.5.15-rel21.0.tar.gz'
homepage 'http://www.percona.com'
md5 'd04b6d1cc863f121f5d1eac8bc618331'
version '5.5.15-21.0'
keg_only "Has the potential to overwrite mysql formula"
@mdabbagh88
mdabbagh88 / fcm.php
Created November 19, 2016 17:44 — forked from sab99r/fcm.php
PHP Function to Send FCM Message to Android
<?php
/*
Parameter Example
$data = array('post_id'=>'12345','post_title'=>'A Blog post');
$target = 'single tocken id or topic name';
or
$target = array('token1','token2','...'); // up to 1000 in one request
*/
public function sendMessage($data,$target){
//FCM api URL
@mdabbagh88
mdabbagh88 / iptables.sh
Created November 13, 2016 14:55 — forked from thomasfr/iptables.sh
iptable rules to allow outgoing DNS lookups, outgoing icmp (ping) requests, outgoing connections to configured package servers, outgoing connections to all ips on port 22, all incoming connections to port 22, 80 and 443 and everything on localhost
#!/bin/bash
IPT="/sbin/iptables"
# Server IP
SERVER_IP="$(ip addr show eth0 | grep 'inet ' | cut -f2 | awk '{ print $2}')"
# Your DNS servers you use: cat /etc/resolv.conf
DNS_SERVER="8.8.4.4 8.8.8.8"
# Allow connections to this package servers
@mdabbagh88
mdabbagh88 / verify_appstore_in_app.php
Created October 31, 2016 17:29 — forked from menny/verify_appstore_in_app.php
How to verify in-app purchases from AppStore and Market in PHP code (server-side)
function verify_app_store_in_app($receipt, $is_sandbox)
{
//$sandbox should be TRUE if you want to test against itunes sandbox servers
if ($is_sandbox)
$verify_host = "ssl://sandbox.itunes.apple.com";
else
$verify_host = "ssl://buy.itunes.apple.com";
$json='{"receipt-data" : "'.$receipt.'" }';
//opening socket to itunes