This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import collections | |
from pymongo import MongoClient | |
from nltk.corpus import stopwords | |
from nltk.collocations import BigramCollocationFinder | |
from nltk.metrics import BigramAssocMeasures | |
from nltk.classify import NaiveBayesClassifier | |
from nltk.classify.util import accuracy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# DNS CONSUL POPULATOR | |
# -*- coding: utf-8 -*- | |
import boto3 | |
import requests | |
from tabulate import tabulate | |
def start_dns(args): | |
""" Start Consul objects """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_company_data(days=7, id=''): | |
symbol = Company.objects.get(pk=id).symbol | |
end = datetime.now().date() | |
start = end - timedelta(days=int(days)) | |
stock_data = web.DataReader('BVMF:{}'.format(symbol), 'google', start, end) | |
stock_days = [] | |
for i, (key, data) in enumerate(stock_data.T.iteritems()): | |
data.dropna(axis=0, inplace=True) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pandas import DataFrame | |
from django.db.models import Q | |
def get_facts(facts, idx, filter_desc=None, label=None, show=False): | |
ret_dict = {} | |
account_number = Q(account__number__in=idx) | |
if filter_desc: | |
facts = facts.filter(account__description__regex=filter_desc) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from channels import Group | |
from ws.models import LocateObject, LocatePath | |
from django.core.serializers import serialize | |
def ws_add(message): | |
message.reply_channel.send({'accept': True}) | |
Group("path").add(message.reply_channel) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Generate user keygen | |
sawtooth keygen vagrant --force | |
# Generate validator key pair | |
sudo sawadm keygen --force | |
# Cleanup sawtooth repo | |
sudo rm -fr /var/lib/sawtooth/; sudo mkdir -p /var/lib/sawtooth ; sudo chown sawtooth /var/lib/sawtooth |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: v1 | |
kind: List | |
items: | |
- apiVersion: extensions/v1beta1 | |
kind: Deployment | |
metadata: | |
name: sawtooth-0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "debian/jessie64" | |
config.disksize.size = '20GB' | |
config.vm.network "private_network", ip: "192.168.99.252" | |
config.vm.synced_folder "~/.projects", "/home/vagrant/projects" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package company | |
import ( | |
"github.com/jinzhu/gorm" | |
_ "github.com/jinzhu/gorm/dialects/postgres" | |
) | |
var Companies []Company | |
type Company struct { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package graph | |
import ( | |
"fmt" | |
"sort" | |
) | |
type Graph struct { | |
Nodes map[string]Fields | |
Links map[string]map[string]Fields |