This file contains hidden or 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
| #!/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 |
This file contains hidden or 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
| 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 * |
This file contains hidden or 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 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) |
This file contains hidden or 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
| 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) |
This file contains hidden or 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
| #!/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 |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| 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", |
This file contains hidden or 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 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', |
This file contains hidden or 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
| 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 |
This file contains hidden or 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
| PUT /test_phrases | |
| { | |
| "mappings": { | |
| "doc": { | |
| "properties": { | |
| "phrases": { | |
| "type": "nested", | |
| "properties": { | |
| "phrase": { | |
| "type": "keyword" |
OlderNewer