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 | |
# https://github.com/Ceryn/img | |
# Call with '-s' to target only a selection of the screen. | |
clientid='3e7a4deb7ac67da' | |
img=$1 | |
res=$(curl -sH "Authorization: Client-ID $clientid" -F "image=@$img" "https://api.imgur.com/3/upload") | |
echo $res | |
echo $res | grep -qo '"status":200' && link=$(echo $res | sed -e 's/.*"link":"\([^"]*\).*/\1/' -e 's/\\//g') |
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 json | |
import sqlalchemy | |
from sqlalchemy import UnicodeText | |
from sqlalchemy.ext.mutable import Mutable | |
from datetime import datetime | |
from collections import OrderedDict | |
__all__ = ('JSON', 'JsonRaw') |
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
# Adapted from http://foobar.lu/wp/2013/07/05/automagic-__repr__-for-sqlalchemy-entities-with-primary-key-columns-with-declarative-base/ | |
class RepresentableBase(object): | |
""" | |
This class can be used by ``declarative_base``, to add an automatic | |
``__repr__`` method to *all* subclasses of ``Base``. This ``__repr__`` will | |
represent values as:: | |
ClassName(pkey_1=value_1, pkey_2=value_2, ..., pkey_n=value_n) |
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
@relayRoot | |
@relayContainer({ | |
client: () => Relay.QL` | |
fragment on Client { | |
id, | |
menuitems(first: 50) { | |
} | |
} | |
` | |
}) |
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
"scripts": { | |
"build-js": "react-native bundle --url 'lib/index.ios.bundle?platform=ios&dev=' --minify && mv ios/main.jsbundle ios/project && git update-index --assume-unchanged ios/project/main.jsbundle", | |
}, |
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
var GraphQL = Relay.QL.__GraphQL; | |
return new GraphQL.QueryFragment( | |
'Builder', 'AddMenuItemPayload', | |
[new GraphQL.Field('node', null, null, null, null, null, {parentType: 'AddMenuItemPayload'}), | |
new GraphQL.Field('client', [ | |
new GraphQL.Field('menuitems', [ | |
new GraphQL.Field('count', null, null, null, null, null, {parentType: 'MenuItemConnection'})], | |
null, | |
[new GraphQL.Callv('first', new GraphQL.CallVariable('format'))], | |
null, null, {parentType: 'Client', connection: true, nonFindable: true}), |
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
# coding: utf-8 | |
# | |
# Usage: python printbon.py | lp -d EPSON_TM-P2.01 | |
from escpos import printer | |
from escpos.constants import FS | |
Epson = printer.Dummy() |
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
/** | |
* Split a properties object into multiple objects based on the | |
* propTypes definitions of components. | |
* | |
* Usage: | |
* | |
* const [modalProps, dialogUIProps, otherProps] = | |
splitProps(this.props, Modal, DialogUI); | |
* | |
* Why? |
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
FAILED: pip3 install --upgrade rtyaml email_validator>=1.0.0 free_tls_certificates>=0.1.3 idna>=2.0.0 cryptography>=1.0.2 boto psutil | |
----------------------------------------- | |
Downloading/unpacking rtyaml | |
Downloading rtyaml-0.0.3.tar.gz | |
Running setup.py (path:/tmp/pip_build_root/rtyaml/setup.py) egg_info for package rtyaml | |
Requirement already up-to-date: email-validator>=1.0.0 in /usr/local/lib/python3.4/dist-packages | |
Downloading/unpacking free-tls-certificates>=0.1.3 | |
Downloading free_tls_certificates-0.1.6.tar.gz | |
Running setup.py (path:/tmp/pip_build_root/free-tls-certificates/setup.py) egg_info for package free-tls-certificates |
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 flask import Flask, current_app | |
from cryptography.hazmat.primitives import hashes | |
import base64 | |
import confcollect | |
from acme import jose | |
DEFAULT_CONFIG = { | |
'DEBUG': False, | |
'ACCOUNT_THUMBPRINT_BASE64': '', | |
'ACCOUNT_JSON': '' |