-
Go to your project's directory
-
Tar up the folder:
tar -C . -zcvf context.tar.gz .
SELECT table, | |
formatReadableSize(sum(bytes)) as size, | |
min(min_date) as min_date, | |
max(max_date) as max_date | |
FROM system.parts | |
WHERE active | |
GROUP BY table |
version: '3.8' | |
services: | |
dynamodb-local: | |
command: '-jar DynamoDBLocal.jar -sharedDb -dbPath ./data' | |
image: 'amazon/dynamodb-local:latest' | |
container_name: dynamodb-local | |
ports: | |
- '8000:8000' | |
volumes: | |
- './docker/volumes/dynamodb:/home/dynamodblocal/data' |
const mongoose = require('mongoose'); // 5.0.17 | |
const MONGO_DB = 'mongodb://localhost/yourdatabasename'; | |
mongoose.connect(MONGO_DB); | |
mongoose.connection.on('open', async () => { | |
const collections = await mongoose.connection.db.listCollections().toArray(); | |
console.log(collections); | |
var collection = mongoose.connection.db.collection('collectionname'); |
class EventEmitter { | |
constructor() { | |
this.events = {}; | |
} | |
on(eventName, callback) { | |
if (this.events[eventName]) { | |
this.events[eventName].push(callback); | |
} else { | |
this.events[eventName] = [callback]; |
const ThemeContext = React.createContext("light"); | |
// Example HOC | |
function withTheme(ThemedComponent) { | |
function ThemeContextInjector(props) { | |
return ( | |
<ThemeContext.Consumer> | |
{value => ( | |
<ThemedComponent {...props} ref={props.forwardedRef} theme={value} /> | |
)} |
const memoize = fn => { | |
const cache = {}; | |
return (...args) => { | |
if (cache[args]) return cache[args]; | |
cache[args] = fn.apply(this, args); | |
return cache[args]; | |
}; | |
}; |
const createDOM = type => (props = {}) => children => ({ | |
type, | |
props, | |
children | |
}); | |
const buildTree = node => { | |
if (!node) return; | |
const { type, props, children } = node; |
server { | |
listen 80; | |
listen [::]:80; | |
server_name <SERVER_NAME> xxx.yoursite.com; | |
return 301 https://xxx.yoursite.com$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name <SERVER_NAME>; |