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
| .swal-overlay--show-modal, | |
| .swal-modal { | |
| animation: none !important; | |
| } |
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
| ::-webkit-scrollbar { | |
| width: 2px; | |
| background-color: rgba(255,255,255,0.3); | |
| } | |
| ::-webkit-scrollbar-thumb:vertical { | |
| background: rgba(255,255,255,0.4); | |
| } |
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
| ['get', 'post', 'put', 'delete'].forEach((method) => { | |
| const originalFn = app[method]; | |
| app[method] = function fn(...args) { | |
| const routeFn = args[args.length - 1]; | |
| const firstArgs = args.slice(0, args.length - 1); | |
| const newRouteFn = (req, res, next) => { | |
| try { | |
| if (routeFn.constructor.name === 'AsyncFunction') { | |
| return routeFn(req, res, next).catch(next); | |
| } |
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
| var collection = 'accounts'; | |
| var bulk = db[collection].initializeUnorderedBulkOp(); | |
| db[collection].find({}).forEach(row => { | |
| const createdAt = dateFromObjectId(row._id); | |
| bulk.find({ _id: ObjectID(row._id) }).updateOne({ $set: { createdAt } }) | |
| }) | |
| bulk.execute() |
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 wait = ms => new Promise(resolve => setTimeout(resolve, ms)); | |
| const retry = async (fn, retryCount = 3, intervalMs = 250, originalError) => { | |
| if (retryCount === 0) { | |
| if (!originalError) throw new Error('Failed after 3 retries'); | |
| throw originalError; | |
| } | |
| try { | |
| const res = fn(); | |
| if (res && typeof res.catch === 'function') { |
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
| onColorSwipe = (e, dx, dy, absX, absY, v) => { | |
| const h = this.colorScroller.scrollHeight; | |
| this.setState(state => { | |
| const top = state.colorScrollerTop + state.colorScrollerDy; | |
| if (-top > h * 4 / 5) { // almost at the end | |
| return { colorScrollerTop: state.colorScrollerTop + h / 3, colorScrollerDy: -dy }; | |
| } | |
| if (-top < h / 5) { // almost at the beginning | |
| return { colorScrollerTop: state.colorScrollerTop - h / 3, colorScrollerDy: -dy }; | |
| } |
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 _ = require('lodash'); | |
| const Redis = require('ioredis'); | |
| const sqlBuilder = require('mongo-sql'); // from https://github.com/smddzcy/mongo-sql#master | |
| const uuid = require('uuid'); | |
| const throat = require('throat'); | |
| const DbError = require('../error/dbError'); | |
| const cast = require('../cast'); | |
| const client = new CosmosClient({ endpoint: '...', key: '...' }); | |
| const database = client.database('...'); |
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
| sudo su | |
| curl -sL https://rpm.nodesource.com/setup_10.x | bash - | |
| sudo yum clean all && sudo yum makecache fast | |
| sudo yum install -y gcc-c++ make | |
| sudo yum install -y nodejs |
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
| Link: https://cloud.ibm.com/docs/services/cloud-object-storage/cli?topic=cloud-object-storage-curl#curl-list-buckets | |
| Policy to add: <CORSConfiguration><CORSRule><AllowedMethod>PUT</AllowedMethod><AllowedMethod>POST</AllowedMethod><AllowedMethod>DELETE</AllowedMethod><AllowedMethod>GET</AllowedMethod><AllowedOrigin>*</AllowedOrigin><AllowedHeader>*</AllowedHeader></CORSRule></CORSConfiguration> |
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
| openssl pkcs12 -in cert.pfx -clcerts -out cert.txt -nodes | |
| # open txt and get certificate + key |