Skip to content

Instantly share code, notes, and snippets.

@dougvk
dougvk / cik_dict.py
Created January 19, 2014 01:40
(stock ticker -> CIK) dictionary using SEC EDGAR
import re
from cPickle import dump
from requests import get
DEFAULT_TICKERS = ['goog', 'aapl']
URL = 'http://www.sec.gov/cgi-bin/browse-edgar?CIK={}&Find=Search&owner=exclude&action=getcompany'
CIK_RE = re.compile(r'.*CIK=(\d{10}).*')
cik_dict = {}
for ticker in DEFAULT_TICKERS:
@raymyers
raymyers / ShellSplitter.java
Last active April 7, 2024 19:11
Simple Java program to tokenize string as a shell would - similar to shlex in Python. Not checked for POSIX compliance yet - feel free to comment with edge cases that could be fixed. This is my original work, free to reuse. Created for Stack Overflow question: https://stackoverflow.com/questions/1082953/shlex-alternative-for-java/20725050:
package com.cadrlife;
import java.util.ArrayList;
import java.util.List;
public class ShellSplitter {
public List<String> shellSplit(CharSequence string) {
List<String> tokens = new ArrayList<String>();
boolean escaping = false;
char quoteChar = ' ';
@efazati
efazati / Py Flask Skeleton
Last active May 12, 2024 00:41
Python Flask Folders and Files structure
.
├── deploy.py
├── project
│   ├── application.py
│   ├── apps
│   │   ├── articles
│   │   │   ├── forms.py
│   │   │   ├── __init__.py
│   │   │   ├── models.py
│   │   │   └── views.py