Skip to content

Instantly share code, notes, and snippets.

@bradmontgomery
bradmontgomery / stripperparser.py
Last active April 1, 2019 18:30
Quick & dirty HTML parsers: 1) Strip all the HTML out of a document, leaving just the document's content, 2) A way to remove all element attributes, leaving just clean markup.
import re
try:
from HTMLParser import HTMLParser # python 2
except ImportError:
from html.parser import HTMLParser # python 3
class HTMLStripperParser(HTMLParser):
"""Simple, stupid parser to remove all HTML tags from
a document. The point is to just get a the data.
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 18, 2025 15:01
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@moklett
moklett / openconnect.md
Created July 24, 2012 15:21
OpenConnect VPN on Mac OS X

Unfortunately, the Cisco AnyConnect client for Mac conflicts with Pow. And by "conflicts", I mean it causes a grey-screen-of-death kernel panic anytime you connect to the VPN and Pow is installed.

As an alternative, there is OpenConnect, a command-line client for Cisco's AnyConnect SSL VPN.

Here's how to get it set up on Mac OS X:

  1. OpenConnect can be installed via homebrew:

     brew update
    

brew install openconnect

@minrk
minrk / SWCDemo.ipynb
Created October 4, 2012 22:32
Demo of hideable hints and scrubbing solutions from IPython notebooks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@zmwangx
zmwangx / fb-dl.py
Last active November 28, 2023 20:29
Scrape all photos from a public Facebook page.
#!/usr/bin/env python
############################### README ###############################
# External dependencies:
# * libmagic
# * python-dateutil
# * python-magic
# * requests
#
# The shell command call at the end was tested with GNU date from GNU
@bonzanini
bonzanini / search_biopython.py
Last active May 19, 2024 08:45
Searching PubMed with Biopython
# This code uses Biopython to retrieve lists of articles from pubmed
# you need to install Biopython first.
# If you use Anaconda:
# conda install biopython
# If you use pip/venv:
# pip install biopython
# Full discussion:
@joyofdata
joyofdata / digits.md
Last active February 2, 2020 02:28
Installing CUDA, cuDNN, caffe and DIGITS on EC2
@karpathy
karpathy / min-char-rnn.py
Last active May 12, 2025 17:28
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@kylemcdonald
kylemcdonald / deep-info.py
Created November 10, 2015 22:39
Download info about GitHub repositories listed in a Google spreadsheet.
#!/usr/bin/env python
from github import Github
import urllib2
import codecs
import sys
import re
UTF8Writer = codecs.getwriter('utf8')
sys.stdout = UTF8Writer(sys.stdout)
oauthToken = open('.oauthToken', 'r').read()
@kylemcdonald
kylemcdonald / CameraImage.cpp
Created November 23, 2015 15:30
openFrameworks app for sending images to disk for processing, and reading text back from disk. Used for "NeuralTalk and Walk".
#include "ofMain.h"
#include "ofxTiming.h"
class ofApp : public ofBaseApp {
public:
ofVideoGrabber grabber;
DelayTimer delay;
ofTrueTypeFont font;
string description;