Skip to content

Instantly share code, notes, and snippets.

Johannes Gårdsted Valbjørn sloev

Block or report user

Report or block sloev

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
View phrase search
View requirements.txt
spacy==2.0.0
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.0.0/en_core_web_sm-2.0.0.tar.gz
networkx>=1.11
@sloev
sloev / gevent_botocore_aws_lambda.py
Created Mar 23, 2017
gevent with botocore example (python 2.7)
View gevent_botocore_aws_lambda.py
from gevent import monkey, joinall, spawn
monkey.patch_all()
import botocore.session
def invoke_lambda():
session = botocore.session.get_session()
client = session.create_client('lambda')
return client.invoke(
FunctionName='test',
View gist:f1eedda4ef97a7ab2ed45f22c7de030c
import boto3, os
from requests_aws4auth import AWS4Auth
from elasticsearch import Elasticsearch, RequestsHttpConnection
creds = boto3.Session().get_credentials()
awsauth = AWS4Auth(
creds.access_key,
creds.secret_key,
"eu-west-1",
View gist:b58d4fb55b81063eba58
WS_INSTRUCTIONS = {}
from functools import wraps
def add_to_ws_lookup(func):
f_name = func.__name__
@wraps(func)
def wrapper(*args, **kwargs):
kwargs['this_func_name']=f_name
return func(*args, **kwargs)
tmp = wrapper
WS_INSTRUCTIONS[f_name] = tmp
View gist:5435400e42cc0eea3bb6
#!/bin/bash
#
# Network configuration for basic server
# ­ using '/bin/ip'
#
# Note: hostname and the lo interface are
# set up by boot.localnet
#
ip="/bin/ip"
dev=eth0
View gist:9b472b81fac002327527
print(wifi.sta.getip())
wifi.setmode(wifi.STATION)
wifi.sta.config("Loppen Public","")
print(wifi.sta.getip())
s=net.createServer(net.TCP,180)
s:listen(2323,function(c)
function s_output(str)
if(c~=nil)
then c:send(str)
View gist:e4d895698a34e4838748
-- a simple http server
srv=net.createServer(net.TCP)
srv:listen(80,function(conn)
conn:on("receive",function(conn,payload)
print(payload)
conn:send("<h1> Hello, NodeMcu.</h1>")
end)
end)
View installs for new photobooth raspbian
python-pip
python-dev
pip install pillow
https://gist.githubusercontent.com/scruss/95c61c9a1501ada2a6c5/raw/5bcedaa64be82854163d3ffa20059df5f7c78d15/esc-pos-image-star.py
er opskrift på python esc *
View esc pos
#!/usr/bin/env python
'''
Created on Apr 15, 2014
@author: johannes
inspired by:
github.com/patriciogonzalezvivo/ofxThermalPrinter
and
Python library for the Adafruit Thermal Printer
You can’t perform that action at this time.