Skip to content

Instantly share code, notes, and snippets.

View RashadSaleh's full-sized avatar

Rashad Saleh RashadSaleh

View GitHub Profile
@RashadSaleh
RashadSaleh / client.js
Created March 10, 2018 13:12
deepstream with GraphQL subscriptions and permissioning
// SYNTACTIC SUGAR ON TOP OF deepstream CLIENT API
var deepstream = require('deepstream.io-client-js');
String.prototype.hash = function() {
var hash = 0, i, chr;
if (this.length === 0) return hash;
for (i = 0; i < this.length; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
@RashadSaleh
RashadSaleh / client.js
Created March 10, 2018 13:11
deepstream with GraphQL subscriptions and permissioning
// SYNTACTIC SUGAR ON TOP OF deepstream CLIENT API
var deepstream = require('deepstream.io-client-js');
String.prototype.hash = function() {
var hash = 0, i, chr;
if (this.length === 0) return hash;
for (i = 0; i < this.length; i++) {
chr = this.charCodeAt(i);
hash = ((hash << 5) - hash) + chr;
hash |= 0; // Convert to 32bit integer
curl -XGET localhost:9200/main/user/_search?pretty -d '{
"query": {
"multi_match" : {
"query": "0789514417 [email protected]",
"type": "cross_fields",
"operator": "or",
"analyzer": "keyword",
"fields": [ "profile.contacts.email.address", "profile.contacts.phone.number" ]
}
}
import * as storage from 'store';
import Intercom from 'intercom.js';
import _ from 'lodash';
var intercom = Intercom.getInstance();
var compare = function (a, b) {
var result = {
different: [],
app.factory('popupManager', function ($ionicPopup) {
var manager = {};
manager.states = {};
manager.states.current;
manager.is_showing_popup = false;
manager.show_popup = function (popup) {
manager.is_showing_popup = true;
switch (popup.type) {
case 'alert':