Skip to content

Instantly share code, notes, and snippets.

@madhums
madhums / graphql-go-mongodb-example.go
Created May 6, 2019 20:47 — forked from trunet/graphql-go-mongodb-example.go
Minimal example of GraphQL Golang and MongoDB playing nicely together. Edit
// Embedded in this article https://medium.com/p/c98e491015b6
package main
import (
"context"
"fmt"
"log"
"net/http"
"time"
@madhums
madhums / producer.js
Created August 30, 2012 13:17
zmq - passing objects to workers
var zmq = require('zmq')
, sock = zmq.socket('push');
sock.bindSync('tcp://127.0.0.1:3000');
console.log('Producer bound to port 3000');
setTimeout(function(){
console.log('sending work');
var data = {
@madhums
madhums / marvel-movies-in-order.md
Created April 27, 2019 17:03
marvel movies to watch in order

Marvel movies in order

  1. Iron Man
  2. The Incredible Hulk
  3. Iron Man 2
  4. Thor
  5. Captain America
  6. Avengers
  7. Iron Man 3
  8. Thor: The Dark World
@madhums
madhums / mapreduce.js
Created August 3, 2011 20:33
mapreduce using mongodb and mongoose
var mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/db_name');
// map function
var map = function(){
emit(this.field_to_group_by, {
other_fields: this.other_fields
// list other fields like above to select them
})
}
{
"Envelope": {
"encodingStyle": "http://schemas.xmlsoap.org/soap/encoding/",
"Body": {
"Fault": {
"faultcode": "soap:Server",
"faultstring": "Execution of ServiceCallout SCO-AddURLVault failed. Reason: ResponseCode 409 is treated as error",
"faultactor": {},
"detail": {
"source": {
@madhums
madhums / docker-compose.yml
Created March 1, 2020 18:16
nextcloud docker
version: '3.2'
services:
nc:
image: nextcloud
volumes:
- ./nextcloud:/var/www/html
ports:
- 8080:80
depends_on: