THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
-- Hex converter, for RGB colors | |
function hex(inp) | |
return inp > 16 and string.format("%X", inp) or string.format("0%X", inp) | |
end | |
-- Battery monitor | |
mybattmon = widget({ type = "textbox", name = "mybattmon", align = "right" }) | |
function battery_status () | |
local output={} -- output buffer | |
local fd=io.popen("acpitool -b", "r") -- list present batteries |
# -*- coding: utf-8 -*- | |
"""Add permissions for proxy model. | |
This is needed because of the bug https://code.djangoproject.com/ticket/11154 | |
in Django (as of 1.6, it's not fixed). | |
When a permission is created for a proxy model, it actually creates if for it's | |
base model app_label (eg: for "article" instead of "about", for the About proxy | |
model). |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
module.exports = (grunt) -> | |
grunt.initConfig | |
# Copy Font Awesome files to /fonts directory | |
copy: | |
fonts: | |
files: [ | |
expand: true | |
cwd: 'bower_components/font-awesome/fonts' |
#include <QtDebug> | |
#include <QImage> | |
#include <QString> | |
#include <QBitArray> | |
#include <QByteArray> | |
#include <QFile> | |
#include <QCommandLineParser> | |
namespace { | |
enum { headerSize = 32 }; |
Python 3.4.3 (default, Mar 26 2015, 22:03:40) | |
[GCC 4.9.2] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> class Pessoa: | |
... pass | |
... | |
>>> type(Pessoa) | |
<class 'type'> | |
>>> class Pessoa2(object): | |
... pass |
import asyncio | |
import itertools | |
def as_completed_with_max_concurrent(futures, max_concurrent, loop=None, timeout=None): | |
"""Tweaked version of `asyncio.as_completed` with the addition of the `max_concurrent` param. | |
The main change is to only queue (`_queue_future`) the first `max_concurrent` futures initially. | |
The rest will be queued in `_on_completion`. | |
""" |
import sys | |
import os | |
from gi.repository import Gtk, Gdk, WebKit | |
class Browser(Gtk.Window): | |
def __init__(self, *args, **kwargs): | |
super(Browser, self).__init__(*args, **kwargs) | |
#!/usr/bin/env python | |
from random import sample | |
from flask import Flask, jsonify | |
app = Flask(__name__) | |
db = { | |
'lotofacil': { | |
'resultados': [ |
import asyncio | |
import logging | |
import time | |
async def do_work(i): | |
print('start', i) | |
# Work | |
time.sleep(1) |