This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select agreement_uuid, term->'uuid' from new_agreements | |
| CROSS JOIN LATERAL jsonb_array_elements(royalties_terms) term | |
| where id = 26 | |
| create type royalties_terms as (uuid text); | |
| select term.*, agreement_uuid as new_agreement_uuid from new_agreements | |
| CROSS JOIN LATERAL jsonb_populate_recordset(null::agreements_royalty_terms, royalties_terms) term | |
| where id = 26 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| '+5533991998109'.replace(/[\S](?=[\w]{4})/g, 'X'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* moduleRaid v5 - https://github.com/@pedroslopez/moduleRaid */ | |
| const moduleRaid=function(){return moduleRaid.mID=Math.random().toString(36).substring(7),moduleRaid.mObj={},fillModuleArray=function(){webpackChunkbuild.push([[moduleRaid.mID],{},function(o){Object.keys(o.m).forEach(function(e){moduleRaid.mObj[e]=o(e)})}])},fillModuleArray(),get=function(o){return moduleRaid.mObj[o]},findModule=function(o){return results=[],modules=Object.keys(moduleRaid.mObj),modules.forEach(function(e){if(mod=moduleRaid.mObj[e],"undefined"!=typeof mod)if("string"==typeof o){if("object"==typeof mod.default)for(key in mod.default)key==o&&results.push(mod);for(key in mod)key==o&&results.push(mod)}else{if("function"!=typeof o)throw new TypeError("findModule can only find via string and function, "+typeof o+" was passed");o(mod)&&results.push(mod)}}),results},{modules:moduleRaid.mObj,constructors:moduleRaid.cArr,findModule:findModule,get:get}}; | |
| window.mR = moduleRaid(); | |
| window.Store = window.mR.findModule('Chat')[0].default; | |
| win |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // firebase-messaging-sw.js | |
| importScripts("https://www.gstatic.com/firebasejs/8.2.6/firebase-app.js"); | |
| importScripts("https://www.gstatic.com/firebasejs/8.2.6/firebase-messaging.js"); | |
| self.addEventListener("notificationclick", function (event) { | |
| var redirectUrl = event.notification.data.FCM_MSG.notification.click_action; | |
| event.waitUntil( | |
| self.clients |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def friends_by_search(term) | |
| friends_path = {} | |
| friends = as(:user).friends(:l, :r, rel_length: { max: 5 }). | |
| where('ANY(title IN l.titles WHERE toLower(title) CONTAINS toLower({title})) OR | |
| ANY(subtitle IN l.subtitles WHERE toLower(subtitle) CONTAINS toLower({title}))'). | |
| where('l <> user'). | |
| params({ title: term }). | |
| to_a |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class UserNeo4j | |
| include Neo4j::ActiveNode | |
| include Neo4j::Timestamps | |
| property :slug | |
| property :first_name | |
| property :last_name | |
| property :website | |
| property :titles | |
| property :subtitles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE OR REPLACE FUNCTION notify_rows_changes() | |
| RETURNS trigger AS $$ | |
| DECLARE | |
| record JSON; | |
| BEGIN | |
| record := row_to_json(CASE TG_OP | |
| WHEN 'INSERT' THEN NEW | |
| WHEN 'UPDATE' THEN NEW | |
| ELSE OLD | |
| END); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... | |
| // Create an http link: | |
| const httpLink = new HttpLink({ | |
| uri: "http://localhost:4000/graphql", | |
| }); | |
| // Create a WebSocket link: | |
| const wsLink = new WebSocketLink({ | |
| uri: `ws://localhost:4000/graphql`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ... | |
| const ROOMS_SUBSCRIPTION = gql` | |
| subscription { | |
| roomUpdatedOrDelete { | |
| operation | |
| record { | |
| id | |
| number | |
| description |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("dotenv").config(); | |
| const { ApolloServer, gql } = require("apollo-server"); | |
| const { createStore } = require("./utils"); | |
| const { merge } = require("lodash"); | |
| const RoomAPI = require("./datasources/room"); | |
| const { typeDef: Room, resolvers: roomResolvers } = require("./schemas/room"); |