Skip to content

Instantly share code, notes, and snippets.

View nvbn's full-sized avatar

Vladimir Iakovlev nvbn

View GitHub Profile
@nvbn
nvbn / example.py
Created September 26, 2012 22:08
Bug #1057167 “global menu not work with PySide apps” : Bugs : appmenu-qt
from PySide.QtCore import Slot, QTranslator, QLocale, Signal, QSettings
from PySide.QtGui import QApplication, QSystemTrayIcon, QMenu, QIcon, QMainWindow
from PySide import QtCore, QtGui
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(800, 600)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
@nvbn
nvbn / gist:4133268
Created November 22, 2012 23:12
plata do not pass the tests
E.EEEE/home/nvbn/work/totemi/ENV/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-11-23 03:10:14.395323) while time zone support is active.
RuntimeWarning)
/home/nvbn/work/totemi/ENV/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-11-23 03:10:14.399392) while time zone support is active.
RuntimeWarning)
E/home/nvbn/work/totemi/ENV/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-11-23 03:10:14.537171) while time zone support is active.
RuntimeWarning)
/home/nvbn/work/totemi/ENV/local/lib/python2.7/site-packages/django/db/models/fields/__init__.py:808: RuntimeWarning: DateTimeField received a naive datetime (2012-11-23 03:10:14.539207) while time zone support is active.
RuntimeWarning)
E/home/nvbn/work/totemi/ENV/local/lib/python2.7/site-pack
@nvbn
nvbn / gist:5074535
Created March 3, 2013 04:41
ppa-stats
➜ /tmp python ppastats.py nvbn-rm ppa quantal i386
everpad 2.5.3-0~quantal 1922
tailme 0.2-1~quantal 3
vkvideo 9-0~quantal 155
➜ /tmp python ppastats.py nvbn-rm ppa quantal amd64
everpad 2.5.3-0~quantal 3826
tailme 0.2-1~quantal 13
vkvideo 9-0~quantal 173
➜ /tmp python ppastats.py nvbn-rm ppa precise amd64
everpad 2.5.3-0~precise 2825
# -*- coding: utf-8 -*-
from random import randint
class Claim(object):
STATE_START = 0
STATE_ANALYZE = 1
STATE_PROCESSING = 2
STATE_CLARIFY = 3
STATE_CLOSE = 4
@nvbn
nvbn / gist:7151773
Created October 25, 2013 09:02
my.conf
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@nvbn
nvbn / indicator.ino
Last active August 29, 2015 14:02
stellaris led indicator
#define LEDS 32
#define ROWS 8
#define IMG 64
#define COLORS 3
#define BLACK 1
#define RED 2
#define GREEN 3
#define BLUE 5
@nvbn
nvbn / order_migrations.py
Created July 29, 2014 00:14
order south migration
from argparse import ArgumentParser
from contextlib import contextmanager
from subprocess import Popen, PIPE
import sys
import os
import re
def git(*args):
resp = Popen(['git'] + list(args), stdout=PIPE, stderr=PIPE)
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332498] ata6.00: exception Emask 0x10 SAct 0x0 SErr 0x90202 action 0xe frozen
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332511] ata6.00: irq_stat 0x00400000, PHY RDY changed
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332521] ata6: SError: { RecovComm Persist PHYRdyChg 10B8B }
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332527] ata6.00: failed command: FLUSH CACHE
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332541] ata6.00: cmd e7/00:00:00:00:00/00:00:00:00:00/a0 tag 1
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332541] res 40/00:04:e8:8e:df/00:00:0a:00:00/40 Emask 0x10 (ATA bus error)
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332548] ata6.00: status: { DRDY }
Jul 30 02:17:51 nvbn-desktop kernel: [ 353.332558] ata6: hard resetting link
Jul 30 02:17:52 nvbn-desktop kernel: [ 354.955509] ata6: SATA link up 6.0 Gbps (SStatus 133 SControl 300)
Jul 30 02:17:52 nvbn-desktop kernel: [ 354.963561] ata6.00: configured for UDMA/133
@nvbn
nvbn / main.py
Last active August 29, 2015 14:11
pyboard uasyncio CPS example
from uasyncio.core import get_event_loop
from ssd1306 import get_display
from ultrasonic import get_ultrasonic
from utils import get_gyro, alts
def main():
display = get_display(pinout={'sda': 'Y10',
'scl': 'Y9'},
height=64,
(ns bf.core)
(defn bf>
[[stack current]]
(let [new-current (inc current)]
[(if (>= new-current (count stack))
(conj stack 0)
stack)
new-current]))