Skip to content

Instantly share code, notes, and snippets.

Barend bvanrijn

Block or report user

Report or block bvanrijn

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@bvanrijn
bvanrijn / bench.txt
Created May 27, 2018 — forked from gabrielhpugliese/bench.txt
Python 3.4 asyncio + aiohttp parallel vs sequential requests
View bench.txt
$python parallel.py
[13:48:59:130701] Doing GET request to http://google.com
[13:48:59:134958] Doing GET request to http://facebook.com
[13:48:59:135498] Doing GET request to http://twitter.com
[13:48:59:136174] Doing GET request to http://slack.com
****** STATUSES: [{'status': 200, 'url': 'http://google.com'}, {'status': 200, 'url': 'http://twitter.com'}, {'status': 200, 'url': 'http://slack.com'}, {'status': 200, 'url': 'http://facebook.com'}]
$python sequential.py
[13:49:04:078752] Doing GET request to http://google.com
[13:49:04:232725] Doing GET request to http://facebook.com
View snakecoin.py
import hashlib as hasher
import datetime as date
# Define what a Snakecoin block is
class Block:
def __init__(self, index, timestamp, data, previous_hash):
self.index = index
self.timestamp = timestamp
self.data = data
self.previous_hash = previous_hash
@bvanrijn
bvanrijn / talkingbots.py
Last active Dec 14, 2016
Talking bots. Oh, my!
View talkingbots.py
from urllib.parse import quote_plus
import requests
import time
class bot():
def __init__(self, name):
self.name = name
self.text = ''
self.said = []
@bvanrijn
bvanrijn / bot.py
Last active Dec 6, 2016
blink(1) telegram bot
View bot.py
import time
import tempfile
import logging
import requests
from colorthief import ColorThief
from blink1.blink1 import Blink1
from telegram.ext import Updater, MessageHandler, Filters
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
View recursive-fibonacci.go
package main
import "fmt"
func F(n int) int {
if n == 0 { return 0 }
if n == 1 { return 1 }
return F(n-2) + F(n-1)
}
View xh-system-convert.py
# -*- coding: utf-8 -*-
'''
usage: python xh-system-convert.py FILE
Converts X or H system to Esperanto alphabet characters in FILE
Written by @grooveplex, released into the public domain under the terms of the
CC0 license.
'''
View mdl.css
body{
font-family: Roboto, sans-serif;
background: #2196f3;
}
.top{
background: #1976d2;
height: 150px;
-webkit-box-shadow: 0px 1px 8px #2c2c2c;
-moz-box-shadow: 0px 1px 8px #2c2c2c;
-ms-box-shadow: 0px 1px 8px #2c2c2c;
View elvis.min.css
.btn{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;font-weight:900;border-radius:5px;color:#fff}.extra-small{height:1.3em;font-size:1em}.small{height:1.4em;font-size:1em}.medium{height:1.5em;font-size:1.1em}.large{height:1.6em;font-size:1.2em}.extra-large{height:1.7em;font-size:1.4em}.btn-success{background:#01c85f}.btn-primary{background:#2491ef}.btn-info{background:#455eb6}.btn-warning{background:#ffd554}.btn-danger{background:#c80435}
View keybase.md

Keybase proof

I hereby claim:

  • I am bvanrijn on github.
  • I am grooveplex (https://keybase.io/grooveplex) on keybase.
  • I have a public key whose fingerprint is 30DB 79D1 084B 5C4F 5BCF DB98 AAA5 F1F2 AFD1 2DE5

To claim this, I am signing this object:

You can’t perform that action at this time.