Skip to content

Instantly share code, notes, and snippets.

View xaviergoby's full-sized avatar
💭
"Normality's a paved road: Comfy to walk, but no flowers grow in it"-V. Van Gogh

Alexander Xavier O'Rourke Goby xaviergoby

💭
"Normality's a paved road: Comfy to walk, but no flowers grow in it"-V. Van Gogh
View GitHub Profile
@xaviergoby
xaviergoby / yahoo_finance.py
Created February 16, 2019 02:09 — forked from scrapehero/yahoo_finance.py
Python 3 code to extract stock market data from yahoo finance
from lxml import html
import requests
from time import sleep
import json
import argparse
from collections import OrderedDict
from time import sleep
def parse(ticker):
url = "http://finance.yahoo.com/quote/%s?p=%s"%(ticker,ticker)
@xaviergoby
xaviergoby / settings.py
Created December 27, 2018 03:37 — forked from nadya-p/settings.py
Simple Python settings class using JSON file as storage
import json
import os
class Settings:
_config_location = 'config.json'
def __init__(self):
if os.path.exists(self._config_location):
self.__dict__ = json.load(open(self._config_location))
@xaviergoby
xaviergoby / bash-cheatsheet.sh
Created November 19, 2018 16:56 — forked from LeCoupa/bash-cheatsheet.sh
Bash CheatSheet for UNIX Systems --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
#!/bin/bash
#####################################################
# Name: Bash CheatSheet for Mac OSX
#
# A little overlook of the Bash basics
#
# Usage:
#
# Author: J. Le Coupanec
# Date: 2014/11/04
@xaviergoby
xaviergoby / database.py
Created October 18, 2018 20:38 — forked from goldsborough/database.py
Python Sqlite3 wrapper
###########################################################################
#
## @file database.py
#
###########################################################################
import sqlite3
###########################################################################
#
@xaviergoby
xaviergoby / withsqlite.py
Created October 18, 2018 20:38 — forked from miku/withsqlite.py
Simple sqlite3 context manager for Python.
#!/usr/bin/env python
import sqlite3
class dbopen(object):
"""
Simple CM for sqlite3 databases. Commits everything at exit.
"""
def __init__(self, path):
self.path = path