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
/** | |
* Defines the function type of the publish function. | |
* | |
* Extracts the keys from `E` as valid event types, and the matching | |
* property as the payload. | |
*/ | |
type PubTypeFn<E> = <Key extends string & keyof E>( | |
event: Key, | |
fn: (message: E[Key]) => void | |
) => void |
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 { DataStore } = require('js-data') | |
class ExtendedDataStore extends DataStore { | |
constructor(props) { | |
super(props) | |
if (props.extends) | |
Object.assign(this, props.extends) | |
} | |
} |
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
Selling security guard services is admittedly not the sexiest of jobs, but with the right attitude and motivation you can do well both professionally and financially. In order to be great at security guard sales, or sales in general, it requires extensive reading and even more practice. One of the first books that I read and refer back to fairly regularly is The 25 Most Common Sales Mistakes and How to Avoid Them by Stephan Schiffman. Stephan is a Certified Management Consultant who has trained and consulted with corporations such as IBM, Motorola, and Cigna. He has trained over 500,000 professionals across 9,000+ companies. Of the 25 most common mistakes outlined in his book, there are 10 that are essential to anyone involved in security guard sales. I have taken the liberty of summarizing those 10 below. | |
Mastering Security Guard Sales | |
Security guard service is one of the most competitive industries that exists (if it isn’t it, sure does feel like it) and losing a sale can be the result of being a pen |
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
/* | |
NOTE: this is a naive first attempt at tailing mongo collections to publish kafka messages | |
and removed module imports and other stuff for brevity.... | |
*/ | |
function normalizeMongoDocument(document) { | |
// convert "_id" to "id" | |
const normalized = { id: document._id, ...document } | |
delete normalized._id |
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
import React from 'react' | |
import useStoreQuery from './useStoreQuery' | |
const ActiveUsers = ({ storeQuery, storeQueryLoading }) => { | |
const { users, loading } = useStoreQuery('users', { where: { active: true } }) | |
return ( | |
<div>{loading ? 'Loading...' : `${users.length} active users found`}</div> | |
) |
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
/* eslint-disable react/no-multi-comp, react/prop-types */ | |
import React from 'react' | |
import hoistNonReactStatic from 'hoist-non-react-statics' | |
import shallowEqual from '../utils/shallowEqual' | |
function ConnectModelsHOC({ loadingProp, modelName, modelNames }, mapPropsWithModels) { | |
return WrappedComponent => { | |
class ConnectModels extends React.Component { | |
static contextType = '' |
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
kafka-node:KafkaClient Connect attempt 1 +0ms | |
kafka-node:KafkaClient Trying to connect to host: 192.168.0.150 port: 9092 +3ms | |
kafka-node:KafkaClient kafka-node-client createBroker 192.168.0.150:9092 +1ms | |
kafka-node:KafkaClient kafka-node-client sending versions request to 192.168.0.150:9092 +902ms | |
kafka-node:KafkaClient broker socket connected {"host":"192.168.0.150","port":"9092"} +3ms | |
kafka-node:KafkaClient connected to socket, trying to load initial metadata +2ms | |
kafka-node:KafkaClient missing apiSupport waiting until broker is ready... +1ms | |
kafka-node:KafkaClient waitUntilReady [BrokerWrapper 192.168.0.150:9092 (connected: true) (ready: false) (idle: false) (needAuthentication: false) (authenticated: false)] +1ms | |
kafka-node:KafkaClient Received versions response from 192.168.0.150:9092 +69ms | |
kafka-node:KafkaClient setting api support to {"21":{"min":0,"max":1,"usable":false},"22":{"min":0,"max":1,"usable":false},"23":{"min":0,"max":2,"usable":false},"24":{"min":0,"max":1,"usable":false},"25":{"min":0,"max |
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
import Reactotron from 'reactotron-react-native'; | |
import sagaPlugin from 'reactotron-redux-saga'; | |
import { reactotronRedux } from 'reactotron-redux'; | |
import envLocal from './.local.json'; | |
export default () => Reactotron | |
// your local IP goes in .env.local.json (which is in .gitignore) | |
.configure({ host: envLocal.ip }) | |
// .use(sagaPlugin()) |
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
<html> | |
<title>Axios Progress Upload</title> | |
<body> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/axios/0.18.0/axios.js"></script> | |
<input id="file" type="file" name="files" multiple="multiple" /><br /> | |
<br> | |
<progress id="progress" max="100" value="0"></progress> |
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
import { DataStore, Mapper } from 'js-data' | |
class ExtendedDataStore extends DataStore { | |
as(name) { | |
const props = {} | |
// const original = super.as(name) | |
const mapper = this.getMapper(name) | |
const self = this | |
// if "this" is passed instead of "self" the downstream methods fail without straightforward Error stacktrace |
NewerOlder