To avoid dealing with duplicate names from different icon styles (solid, regular, etc.), just use apply
!
This file contains 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
# as opposed to setuptools-dependent http://pytest.org/latest/goodpractises.html#integration-with-setuptools-test-commands | |
# or non-OSS and incredibly verbose http://pytest.org/latest/goodpractises.html#integrating-with-distutils-python-setup-py-test | |
# just call this "mypackage.run_disutils" and then | |
# test_suite="mypackage.run_distutils" | |
import unittest | |
import pytest | |
class TestSuite(unittest.TestCase): | |
def test_sqlalchemy(self): |
This file contains 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
<?php | |
function is_prime_overkill($int){ | |
static $ints; | |
if(!$ints){ | |
//quick skips | |
$ints = array(0=>false, 1=>false, 2=>true, 3=>true, 4=>false, 5=>true); | |
} | |
$index = strval($int); | |
if(!isset($ints[$index])){ | |
$ints[$index] = true; |
This file contains 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
#~/.janus.rake file | |
vim_plugin_task "autoclose", "git://github.com/Townk/vim-autoclose.git" | |
#~/vimrc.local file | |
let g:AutoClosePairs = {'(': ')', '{': '}', '[': ']', '"': '"', "'": "'", '#{': '}', '|':'|' } | |
let g:AutoCloseProtectedRegions = ["Character"] | |
This file contains 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 django.http import HttpResponseRedirect | |
from django.conf import settings | |
from re import compile | |
EXEMPT_URLS = [compile(settings.LOGIN_URL.lstrip('/'))] | |
if hasattr(settings, 'LOGIN_EXEMPT_URLS'): | |
EXEMPT_URLS += [compile(expr) for expr in settings.LOGIN_EXEMPT_URLS] | |
class LoginRequiredMiddleware: | |
""" |
This file contains 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 python:3.7-slim-stretch AS build | |
RUN \ | |
apt-get -q update \ | |
&& apt-get -q install -y --no-install-recommends \ | |
build-essential \ | |
libssl-dev \ | |
&& rm -rf /var/lib/apt/lists/* \ | |
&& pip install -U pip |
This file contains 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
var pg = require('pg'); | |
var client = new pg.Client('postgresql://username:password@localhost:5432/labs'); | |
client.connect(); | |
client.query('LISTEN events', function(err, msg) { | |
if (err) throw err; | |
}); |
This file contains 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
"""A plain asyncio program that uses asyncpg to run some rows into a table and | |
select them. | |
This is a "control" program which we will compare to the one which uses calls | |
from an implicit IO greenlet at | |
https://gist.github.com/zzzeek/4e89ce6226826e7a8df13e1b573ad354. | |
Performance against a PG database over a wired network | |
Ran 40000 records in 40 concurrent requests, Total time 5.560306 |
OlderNewer