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 bs4 import BeautifulSoup as bs | |
import urllib3 | |
def scrape_industries(site='https://angel.co/markets'): | |
http = urllib3.PoolManager() | |
r = http.request('GET', site) | |
if r.status != 200: | |
return False |
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
{{if response.flash:}} | |
<header style="padding-top: 35px"> | |
{{if 'errors' in response.flash:}} | |
<div class="alert alert-block alert-error fade in"> | |
<button type="button" class="close" data-dismiss="alert"> | |
× | |
</button> | |
<p> | |
{{=response.flash}} | |
</p> |
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 uuid4(): | |
"""Generate a random UUID.""" | |
# When the system provides a version-4 UUID generator, use it. | |
if _uuid_generate_random: | |
_buffer = ctypes.create_string_buffer(16) | |
_uuid_generate_random(_buffer) | |
return UUID(bytes=_buffer.raw) | |
# Otherwise, get randomness from urandom or the 'random' module. |
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 win32com.client # If I can be bothered, will switch to using an Open Source cross-platform API | |
from glob import glob | |
from PyPDF2 import PdfFileReader | |
from os import getcwd | |
from datetime import datetime | |
def pdf_page_count(filename): | |
curr = open(filename, "rb") |
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
/* render website with JS and return its rendered output | |
Syntax: node nodejs_phantomjs_render.js [url] [output {default=stdout}] */ | |
var system = require('system'), | |
fs = require('fs'), | |
page = new WebPage(), | |
url = system.args[1], | |
output = system.args[2], | |
result; |
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 346740535fe71b34218fa1137a14e6ed8f6833ae Mon Sep 17 00:00:00 2001 | |
From: Samuel Marks <[email protected]> | |
Date: Fri, 8 Nov 2013 22:04:06 +1100 | |
Subject: [PATCH] Added support for the BSDs and Solaris endianness; code from | |
ChromiumOS project (LevelDB ppl) | |
--- | |
include/llvm/Support/Host.h | 17 ++++++++++------- | |
1 file changed, 10 insertions(+), 7 deletions(-) |
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
\documentclass[a4paper,11pt]{article} | |
\usepackage[english]{babel} | |
\usepackage{amsmath,amssymb,cancel,array,graphics,enumerate,fancyhdr,graphviz,psfrag,minted} | |
\usepackage{ucs} | |
\usepackage[utf8x]{inputenc} | |
\title{} | |
\author{Samuel Marks} | |
\begin{document} |
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
""" | |
Simple algorithm to download all the egghead.io videos in highest-quality from YouTube. | |
Run from the directory you want the videos to appear. Renames them so that they have the video number + omit the repetitive "Egghead.io - AngularJS -" text. | |
Installing dependency: | |
$ pip install git+https://github.com/NFicano/pytube#egg=pytube | |
""" | |
from pytube import YouTube #, exceptions as YTD_exceptions |
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
#!/usr/bin/env python | |
from sys import argv, exit | |
if __name__ == '__main__': | |
if len(argv) < 2: | |
print "USAGE: {0} MODULE [SYMBOL]".format(argv[0]) | |
print "Open help() for given module, or given symbol from module" | |
exit(1) |
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 json import dumps, loads | |
from uuid import uuid4 | |
from collections import OrderedDict | |
from klein import Klein | |
from exceptions import BaseException | |
class UniqueKeyError(BaseException): | |
pass |
OlderNewer