Skip to content

Instantly share code, notes, and snippets.

View valiantone's full-sized avatar
🌪️
learning to embrace chaos

Zubin J valiantone

🌪️
learning to embrace chaos
View GitHub Profile
@valiantone
valiantone / keybase.md
Created September 23, 2016 15:43
Keybase proof

Keybase proof

I hereby claim:

  • I am valiantone on github.
  • I am valiantone (https://keybase.io/valiantone) on keybase.
  • I have a public key whose fingerprint is 2464 D455 BD60 925C 29B3 E021 12D9 855D D102 11C4

To claim this, I am signing this object:

@valiantone
valiantone / mongodb_hook.py
Created April 17, 2018 12:23 — forked from gghez/mongodb_hook.py
MongoDB Hook for Airflow system.
from airflow.hooks.base_hook import BaseHook
from pymongo import MongoClient
class MongoDBHook(BaseHook):
def __init__(self, conn_id='mongodb_default'):
self.conn = self.get_connection(conn_id)
self.client = MongoClient(host=self.conn.host, port=self.conn.port)
def __getattr__(self, name):
@valiantone
valiantone / hash.py
Created October 4, 2019 13:30 — forked from scwood/hash.py
python hash table using linear probing
class HashTable(object):
def __init__(self):
self.max_length = 8
self.max_load_factor = 0.75
self.length = 0
self.table = [None] * self.max_length
def __len__(self):
return self.length
import pymongo
client = pymongo.MongoClient("mongodb://valiantone:secretPassword@123.45.67.89/my_db") # defaults to port 27017
db = client.cool_db
# print the number of documents in a collection
print db.cool_collection.count()
@valiantone
valiantone / pandas_labeled_csv_import_to_mongo.py
Created February 28, 2020 15:18 — forked from jxub/pandas_labeled_csv_import_to_mongo.py
A simple mongoimport for importing csv files with python and pymongo
import pandas as pd
from pymongo import MongoClient
import json
def mongoimport(csv_path, db_name, coll_name, db_url='localhost', db_port=27000)
""" Imports a csv file at path csv_name to a mongo colection
returns: count of the documants in the new collection
"""
client = MongoClient(db_url, db_port)
db = client[db_name]
@valiantone
valiantone / mongo_to_csv.py
Created February 28, 2020 15:19 — forked from mieitza/mongo_to_csv.py
python mongo to csv use pandas.
# @Author: xiewenqian <int>
# @Date: 2016-11-28T20:35:09+08:00
# @Email: wixb50@gmail.com
# @Last modified by: int
# @Last modified time: 2016-12-01T19:32:48+08:00
import pandas as pd
from pymongo import MongoClient
train = pd.DataFrame([
    {"Name": "Olyphant", "FamilySize": 1},
    {"Name": "Rodent", "FamilySize": 3},
    {"Name": "Possum", "FamilySize": 1},
])

sub = train[train["FamilySize"] == 1]
sub["isAlone"] = 1
train

Installing Cool-Retro-Term on Windows10

First of all, this document is just a recompilation of different resources that already existed on the web previously that I personally tested some ones did work and other not. I liked the idea to make a full guide from start to end so all of you could also enjoy playing with cool-retro-term on windows 10. Personally I installed it on a windows 10 pro version. Fingers crossed!

result