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 / Dockerfile
Last active September 28, 2015 16:53
Docker Compose example
FROM python:2.7
ADD . /code
RUN pip install -r requirements.txt
CMD python
derek-adair /
Created February 18, 2016 18:00 — forked from drgarcia1986/
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
#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))
version: '2'
image: selenium/hub:${SEL_VERSION}
- "4444:4444"
image: selenium/node-firefox:${SEL_VERSION}
ceback (most recent call last):
File "", line 7, in <module>
File "/virtualenv/lib/python3.5/site-packages/aldryn_django/", line 11, in manage
File "/virtualenv/lib/python3.5/site-packages/django/core/management/", line 346, in execute
File "/virtualenv/lib/python3.5/site-packages/django/core/management/", line 394, in run_from_argv
self.execute(*args, **cmd_options)
File "/virtualenv/lib/python3.5/site-packages/django/core/management/", line 445, in execute
### WordPress Environment ###
Home URL: https://**********
Site URL: https://**********
WC Version: 3.5.2
Log Directory Writable: ✔
WP Version: ❌ 4.9.8 - There is a newer version of WordPress available (5.0.3)
WP Multisite: –
WP Memory Limit: 768 MB
//Object.keys returns an array like ['username/clipname': {name: clipname, mp3_file:<link_to_mp3>}]
userClips = Object.keys(clips)
// filter the array to only include those that start with the username
.filter(clip => !clip.indexOf(`${username}/`))
// reduces the original object key array using object explode syntax
.reduce((obj, key)=>{
return {
// obj is exploded, its the accumulation of the reduce
// inserts the clip into the accumulator
newState = Object.assign({}, state),
library_clips = newState.library[action.library_owner].clips,
clip_index = library_clips.indexOf(`${action.clip.user}/${}`)
library_clips.splice(clip_index, 1)
return newState
derek-adair /
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