Skip to content

Instantly share code, notes, and snippets.

View derek-adair's full-sized avatar
🎯
Starting a thing

Derek derek-adair

🎯
Starting a thing
View GitHub Profile
@derek-adair
derek-adair / vim_with_python.sh
Last active March 25, 2020 16:55
Compile and install vim w/ YouCompleteMe
#Install the deps
sudo apt install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev ruby-dev lua5.1 liblua5.1-dev libperl-dev git
#Remove all the vims
sudo apt remove vim vim-runtime gvim vim-tiny vim-common
# Make sure they are alllll gone
ceback (most recent call last):
File "manage.py", line 7, in <module>
startup.manage(path=os.path.dirname(os.path.abspath(__file__)))
File "/virtualenv/lib/python3.5/site-packages/aldryn_django/startup.py", line 11, in manage
utility.execute()
File "/virtualenv/lib/python3.5/site-packages/django/core/management/__init__.py", line 346, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/virtualenv/lib/python3.5/site-packages/django/core/management/base.py", line 445, in execute
version: '2'
services:
hub:
image: selenium/hub:${SEL_VERSION}
ports:
- "4444:4444"
firefox:
image: selenium/node-firefox:${SEL_VERSION}
volumes:
#requires aiohttp - navigate to localhost:8080/?domain={domain_to_scrape}
from aiohttp import web
import aiohttp
import asyncio
async def handle(request):
domain = '//{}'.format(request.GET['domain'])
loop = asyncio.get_event_loop()
with aiohttp.ClientSession(loop=loop) as session:
print("fetching from {}".format(domain))
@derek-adair
derek-adair / tornado_asyncio.py
Created February 18, 2016 18:00 — forked from drgarcia1986/tornado_asyncio.py
Tornado and Asyncio Mixed example
# -*- coding: utf-8 -*-
import asyncio
import re
import asyncio_redis
import tornado.concurrent
import tornado.httpclient
import tornado.web
import tornado.platform.asyncio
@derek-adair
derek-adair / Dockerfile
Last active September 28, 2015 16:53
Docker Compose example
FROM python:2.7
ADD . /code
WORKDIR /code
RUN pip install -r requirements.txt
CMD python app.py