Please see: https://github.com/kevinSuttle/html-meta-tags, thanks for the idea @dandv!
Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/
#!/usr/local/bin/python | |
import sys, Image | |
if __name__ == '__main__': | |
fn = sys.argv[1] | |
img = Image.open(fn).convert('YCbCr') | |
w, h = img.size | |
data = img.getdata() | |
cnt = 0 |
import logging | |
from termcolor import colored | |
class ColorLog(object): | |
colormap = dict( | |
debug=dict(color='grey', attrs=['bold']), | |
info=dict(color='white'), | |
warn=dict(color='yellow', attrs=['bold']), |
class Backend(object): | |
def __init__(self): | |
engine = create_engine("mysql://{0}:{1}@{2}/{3}".format(options.mysql_user, options.mysql_pass, options.mysql_host, options.mysql_db) | |
, pool_size = options.mysql_poolsize | |
, pool_recycle = 3600 | |
, echo=options.debug | |
, echo_pool=options.debug) | |
self._session = sessionmaker(bind=engine) | |
@classmethod |
-- | |
-- ** setting up example tables and data ** | |
-- | |
-- | |
CREATE TABLE task ( | |
id BIGSERIAL , | |
name TEXT, | |
parent_id BIGINT REFERENCES task(id), | |
PRIMARY KEY (id) |
#!/usr/bin/python | |
# This script help you extract image files from an APK file. | |
# Author : Daehee Han (https://github.com/booknara, @daniel_booknara) | |
# Date : August 21 2013 | |
# Basic Usage | |
# (1) img_extractor.py --ifile <APK file> --ofile <Destination Directory> | |
# (2) img_extractor.py --ifile <APK file> --ofile . | |
# (3) img_extractor.py --ifile <APK file> --ofile .. |
from elasticsearch import Elasticsearch | |
es = Elasticsearch() | |
res = es.get(index="belajar", doc_type='pesan', id=1) | |
print(res['_source']) |
# This is an example of metaprogramming in the Elixir language. | |
# | |
# We will define a domain specific language (DSL) for the definition | |
# of a service which is watched by several sensors. | |
# Each sensor watches some property/functionality of the service and | |
# returns the result of the check. | |
# | |
# To determine if the service is functioning properly, we need functions | |
# to run all the sensors' code and gather the returned data. | |
# |
def get_count(q): | |
count_q = q.statement.with_only_columns([func.count()]).order_by(None) | |
count = q.session.execute(count_q).scalar() | |
return count | |
q = session.query(TestModel).filter(...).order_by(...) | |
# Slow: SELECT COUNT(*) FROM (SELECT ... FROM TestModel WHERE ...) ... | |
print q.count() |