Skip to content

Instantly share code, notes, and snippets.

View frenchbread's full-sized avatar
🎯
Focusing

Damir Mustafin frenchbread

🎯
Focusing
  • Wunderdog Oy
  • Finland
View GitHub Profile
@frenchbread
frenchbread / sampleData.js
Created July 28, 2015 13:08
sample elasticSearchData
var sampleData = [
{
_index:'api-umbrella-logs-v1-2015-07',
_type:'log',
_id:'aec9623pqq4mjk7bs77g',
_score:1,
fields:{
request_at:[
Object
],
@frenchbread
frenchbread / templateOnSubmitEvent.js
Created August 10, 2015 12:06
Peace of art actually lol :)
'submit #apiConfigurationUploadForm': function (event, template) {
// calling method that converts YAML to JSON and returns Json object
Meteor.call("convertYamlToJson", template.reactiveFile.get().name, function (err, jsonFile) {
// logging an error if one exists
if (err) console.log(err);
// iterating through JSON object keys
for (var key in jsonFile) {
from scipy.spatial import distance
import numpy as np
from sklearn.svm import SVC
file = 'iris.txt'
f = open(file)
data = []
for line in f:
Template.importApiDocumentation.events({
'change #apiDocumentationFile': function (event/*, template*/) {
var customProxy = "umbrella.apinf.io";
var customBasePath = "/api-umbrella";
// Gets selected file from the form
var file = event.target.files[0];
// Initialises new reader instance
function getCalledMethod(text, commandsList){
for (var key in commandsList) {
if (commandsList.hasOwnProperty(key)) {
//console.log(key + " -> " + commandsList[key]);
if (S(text).contains("/" + key)){
return commandsList[key];
}
}
}
var config = {
host: "hostname"
};
var options = {
index: 'api-umbrella-logs-v1-2015-12',
type: 'log',
size: 10,
query: {
match_all: {}
@frenchbread
frenchbread / nodereinstall.sh
Created May 5, 2016 20:57 — forked from brock/nodereinstall.sh
Complete Node Reinstall. I've moved this to a repo at http://git.io/node-reinstall
#!/bin/bash
# node-reinstall
# credit: http://stackoverflow.com/a/11178106/2083544
## program version
VERSION="0.0.13"
## path prefix
PREFIX="${PREFIX:-/usr/local}"
import oracledb from 'oracledb';
Meteor.methods({
submitStatement (data) {
const oracleResponse = Async.runSync(function (done) {
oracledb.getConnection(oracleConf, (err, connection) => {
if (err) done(err);
@frenchbread
frenchbread / elasticsearch-available-fields.js
Created June 30, 2016 07:24
List of fields that are available on each log entry inside ElasticSearch.
// List of fields that are available on each log entry inside ElasticSearch.
const fieldsList = [
'api_key',
'backend_response_time',
'internal_gatekeeper_time',
'internal_response_time',
'proxy_overhead',
'request_accept',
'request_accept_encoding',
'request_at',
{
"10000": {
"time": 89,
"{}": {
"filter": 2,
"groups": {
"15": 1,
"60": 0,
"720": 1,
"1440": 0,