Skip to content

Instantly share code, notes, and snippets.

@yanmendes
yanmendes / a.js
Created September 29, 2017 18:19
models.Traffic.destroy({
where: {}
}).then(function () {
return models.TrafficFull.destroy({where: {}});
}).then(function () {
return new Promise(function(resolve, reject) {
var since = new Date(req.body.since);
var to = new Date(req.body.to);
var pad = '00';
var subqueries = [];
//Refactor: do this in a smarter way
let columns = []
_.each(res.results, res => {
_.each(Object.keys(res), key => {
if (!_.find(columns, o => o.key === key))
columns.push({ key: key, title: key, dataIndex: key })
})
})
return (
<Mutation<RegisterMutation, RegisterMutationVariables> mutation={registerMutation}>
{
mutate => (
)
}
</Mutation>
)
import Prov from "../models/Prov";
import Provone from "../models/Provone";
import {
SQL_INNER_JOIN,
SQL_UNION,
SQL_LEFT_JOIN
} from "../mediators/mediationTypes";
import * as lodash from "lodash";
const filterObjectByKeys = (object: any, allowed: Array<any>): Object =>
import Prov from "../models/Prov";
import Provone from "../models/Provone";
import {
SQL_INNER_JOIN,
SQL_UNION,
SQL_LEFT_JOIN
} from "../mediators/mediationTypes";
import * as lodash from "lodash";
const filterObjectByKeys = (object: any, allowed: Array<any>): Object =>
@yanmendes
yanmendes / kepler.mediator.js
Created April 10, 2019 19:20
kepler.mediator.js
import Prov from "../models/Prov";
import Provone from "../models/Provone";
import {
SQL_INNER_JOIN,
SQL_UNION,
SQL_LEFT_JOIN
} from "../mediators/mediationTypes";
import * as lodash from "lodash";
const filterObjectByKeys = (object: any, allowed: Array<any>): Object =>
package proxy
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"regexp"
"strconv"
)
package proxy
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"regexp"
"strconv"
)
package proxy
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"regexp"
"strconv"
)
package proxy
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"regexp"
"strconv"
)