I hereby claim:
- I am bjarneo on github.
- I am bjarneo (https://keybase.io/bjarneo) on keybase.
- I have a public key ASCCxN0Me82nYqYxqHgRtZkKdRNYl64Ohp5Xb4b0IFI58Qo
To claim this, I am signing this object:
const tmi = require('tmi.js'); | |
// Define configuration options | |
const opts = { | |
identity: { | |
username: 'your_username', | |
password: 'oauth:your_secret_password' // get the password from https://twitchapps.com/tmi/ | |
}, | |
channels: ['your_channel_name'] | |
}; |
// find date GTE and LT | |
db.collection.find({createdAt: { $gte: ISODate("2019-04-10T00:00:00Z"), $lt: ISODate("2019-05-10T00:00:00Z") }}).count() | |
// find and sorted with limit | |
db.collection.find().sort({_id: -1}).limit(1).pretty() | |
// Remove from array | |
db.studios.find().toArray().map(item => item._id).forEach(id => db.studios.update({_id: id}, { $pull: { modules: { type: "commentsModule" } } })); | |
// Update one property |
# The build stage | |
FROM node:9.5-alpine as builder | |
WORKDIR /app | |
COPY package-lock.json . | |
COPY package.json . | |
RUN npm i |
import merge from 'deepmerge'; | |
import delve from 'dlv'; | |
import defaultConfig from './default'; | |
const { REACT_APP_ENV, NODE_ENV } = process.env; | |
const ENV = REACT_APP_ENV || NODE_ENV; | |
const config = () => { | |
try { |
I hereby claim:
To claim this, I am signing this object:
module.exports = { | |
settings: { | |
runtime: { /* ... */ }, | |
build: { /* ... */ }, | |
}, | |
webpack: (target) => { | |
const settings = require('roc').getSettings(); | |
console.log(target); // web or node |
// Shortcode usage in the WYSIWYG: [iframe src="https://gist.github.com/bjarneo/65115610d02ac0dd77597464014bddfb"] | |
function iframe($atts) { | |
return sprintf( | |
'<iframe src="%s" />', | |
$atts['src'] | |
); | |
} | |
add_shortcode('iframe', 'iframe'); |
# Delete all containers | |
docker rm $(docker ps -a -q) | |
# Delete all images | |
docker rmi -f $(docker images -q) | |
# Delete all | |
docker rm -v $(docker ps -a -q -f status=exited) | |
docker rmi -f $(docker images -f "dangling=true" -q) |
const events = {}; | |
function on(event, callback) { | |
if (!events[event]) { | |
events[event] = []; | |
} | |
events[event].push(callback); | |
} |
// Remove N documents from collection | |
var idsToRemove = db.collection.find({ "query": "to perform" }).limit(10000).sort({ "_id": -1 }).toArray().map(function(doc) { return doc._id; }); | |
db.collection.remove({ "_id": { $in: idsToRemove }}) | |
// Update | |
db.collection.update({ "_id": { $set: { "test": "update" } } }); | |
// Get current operations | |
db.currentOp(); |