Skip to content

Instantly share code, notes, and snippets.

Avatar

David Foster davidfstr

View GitHub Profile
View pipenv-lock-yaml.txt
$ pipenv lock --verbose
Locking [dev-packages] dependencies...
Locking [packages] dependencies...
using sources: [{'url': 'https://pypi.org/simple', 'verify_ssl': True, 'name': 'pypi'}]
Using pip: -i https://pypi.org/simple
ROUND 1
Current constraints:
ruamel.yaml==0.10.11 (from -r /var/folders/vm/nd6nhd948xj4ds001s76srj80000gn/T/pipenv-quepzcpu-requirements/pipenv-btnrwlic-constraints.txt (line 2))
View debug_twisted.py
def main():
fork_and_continue_in_child()
setup_reactor('AsyncioSelectorReactor')
run_server()
def setup_reactor(reactor_type):
if reactor_type == 'AsyncioSelectorReactor':
from twisted.internet import asyncioreactor
asyncioreactor.install()
elif reactor_type == 'SelectReactor':
View gist:628b1d885e6fb6b8159655a37d2cb628
$ python3 runtests.py mypy.test.testsemanal
PARALLEL 2
SUMMARY 3 tasks selected
passed 2, failed 1, pending 0; running 0
FAILURE #0 run unit-test mypy.test.testsemanal
Expected:
...
ImportFrom:1(mypy.typing, [TypedDict])
@davidfstr
davidfstr / gist:b3697cf83b1935f24ef5
Created Mar 23, 2016
urllib3: No module named 'socks'
View gist:b3697cf83b1935f24ef5
python setup.py develop
/urllib3/venv/lib/python3.4/site-packages/setuptools/dist.py:294: UserWarning: The version specified ('dev') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.
"details." % self.metadata.version
running develop
running egg_info
creating urllib3.egg-info
writing requirements to urllib3.egg-info/requires.txt
writing top-level names to urllib3.egg-info/top_level.txt
writing dependency_links to urllib3.egg-info/dependency_links.txt
writing urllib3.egg-info/PKG-INFO
@davidfstr
davidfstr / reflect_client_urllib3.py
Created Mar 18, 2016
urllib3: Test header order preservation
View reflect_client_urllib3.py
from collections import OrderedDict
import urllib3
http = urllib3.PoolManager()
response = http.request(
method='GET',
url='http://127.0.0.1:8765/',
headers=OrderedDict([
('X-Header-1', 'ignoreme'),
@davidfstr
davidfstr / reflect_client.py
Created Mar 8, 2016
requests: Request header ordering test
View reflect_client.py
from collections import OrderedDict
import requests
try:
requests.get(
'http://127.0.0.1:8765/',
headers=OrderedDict([
('X-Header-1', 'ignoreme'),
('X-Header-2', 'ignoreme'),
('X-Header-3', 'ignoreme'),
View rdiscount_with_toc.rb
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
require 'rdiscount'
rd = RDiscount.new("# 中\n\n## 学\n\n####私", :generate_toc)
print rd.to_html
@davidfstr
davidfstr / Code.gs
Created Jan 18, 2015
MediaQueue 1.0
View Code.gs
/*
* MediaQueue
*
* A system for quickly searching for media items (movies, TV series, anime, books)
* in various different media sources.
*
* If you're reading this file then you might be interesting in either understanding
* how it works or extending it (especially to add new kinds of media sources).
* Useful starting points:
*
@davidfstr
davidfstr / index.html
Last active Dec 26, 2015
JavaScript Code Conventions
View index.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
<style>
h1,
h2,
h3,
h4,
View Tutorial2B.java
//package vlcj.tutorial2;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import uk.co.caprica.vlcj.binding.LibVlc;
import uk.co.caprica.vlcj.component.EmbeddedMediaPlayerComponent;
import uk.co.caprica.vlcj.runtime.RuntimeUtil;
import com.sun.jna.Native;
You can’t perform that action at this time.