This file contains 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 sys | |
from gi.repository import Clutter | |
stage_size = (800, 600) | |
Clutter.init(sys.argv) | |
stage = Clutter.Stage() | |
stage.set_size(*stage_size) | |
stage.set_title('Problems...') |
This file contains 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 sys | |
from gi.repository import Clutter | |
stage_size = (800, 600) | |
Clutter.init(sys.argv) | |
stage = Clutter.Stage() | |
stage.set_size(*stage_size) | |
stage.set_title('Problems...') |
This file contains 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 sys | |
from gi.repository import Clutter | |
Clutter.init(sys.argv) | |
stage = Clutter.Stage() | |
stage.set_size(350, 200) | |
stage.set_title('Fixed Position') | |
def color(string): |
This file contains 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
M140 S60.000000 | |
M109 T0 S210.000000 | |
T0 | |
M190 S60.000000 | |
;Sliced at: Sat 19-04-2014 17:01:35 | |
;Basic settings: Layer height: 0.1 Walls: 1 Fill: 20 | |
;Print time: #P_TIME# | |
;Filament used: #F_AMNT#m #F_WGHT#g | |
;Filament cost: #F_COST# | |
;M190 S60 ;Uncomment to add your own bed temperature line |
This file contains 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 http://stackoverflow.com/a/14776693/999193 | |
import sys | |
def myexcepthook(type, value, tb): | |
import traceback | |
from pygments import highlight | |
from pygments.lexers import get_lexer_by_name | |
from pygments.formatters import TerminalFormatter |
This file contains 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
class SerialThreadTX(SerialThread): | |
def run(self): | |
self.msggen.directdisplay('==== Started TX Thread') | |
self.tracemanager.start_trace() | |
while(True): | |
if self.timeToQuit.isSet(): | |
break | |
# The maximum TX buffer for the COM-port driver set in w32Serial.py. |
This file contains 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
lass __WeakWrapper(object): | |
def __init__(self, sender, callback, *userdata): | |
self.weak_obj = weakref.ref(callback.im_self) | |
self.weak_fun = weakref.ref(callback.im_func) | |
self.userdata = userdata | |
self.sender = sender | |
self.handle = None | |
def __call__(self, source): | |
obj = self.weak_obj() |
This file contains 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
#define DEBOUNCE_DELAY 100 | |
class Button | |
{ | |
public: | |
Button(int p_Pin) /*Constructor*/ | |
{ | |
l_Pin = p_Pin; | |
pinMode(l_Pin,INPUT); |
This file contains 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 | |
from gi.repository import Clutter | |
import cairo | |
import math | |
color = lambda string: Clutter.color_from_string(string)[1] # shortcut | |
class CairoActor(Clutter.Actor): | |
'''a horizontal item inside a row''' |
This file contains 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 __future__ import print_function | |
import time | |
print_func = print | |
def format_sec(milliseconds): | |
return '{:>8.3f} sec.'.format(milliseconds / 1000.0) | |
current_milli_time = lambda: int(round(time.time() * 1000)) |
OlderNewer