Skip to content

Instantly share code, notes, and snippets.

Thomas Weller thomasw-mitutoyo-ctl

Block or report user

Report or block thomasw-mitutoyo-ctl

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:7d7af3269280941fc600b20c12d4456a
from luma.core.interface.serial import spi, noop
from luma.core.render import canvas
from luma.core.legacy import text
from luma.core.legacy.font import LCD_FONT, proportional
from luma.led_matrix.device import max7219
from time import sleep
serial = spi(port=0, device=0, gpio=noop())
scoreboard = max7219(serial, cascaded=4, block_orientation=-90)
scoreboard.contrast(20)
View gist:89d1da16161325a8b1282d519ca95a4d
from time import sleep
from luma.core.render import canvas
from luma.led_matrix.device import ws2812
'''
Pin connections:
VCC (red): 5 Volt, don't use Raspberry's power, because it may draw a lot of current
DIN (green): Pin 12, GPIO18
GND (white): Common ground
'''
View Clean Architecture.md

Clean-Architecture

Notes, comments and errata on Robert C. Martin's Clean Architecture

Reading the book

The book has 34 chapters, with a maximum of 22 pages (chapter 14). Even while involved as a programmer in a project, it should be possible to read one chapter per day, so you can finish the book in about 2 months.

Errata

Page 15, just before subchapter "The greater value".

@thomasw-mitutoyo-ctl
thomasw-mitutoyo-ctl / gist:9dc43e0ec0d41af970d3a5c755c1cb74
Last active Apr 26, 2018 — forked from pdwetz/gist:5368441
Outputs a POCO for a given MySql table. Based on http://stackoverflow.com/a/13918084/21865 with changes for ShaoLinq.
View gist:9dc43e0ec0d41af970d3a5c755c1cb74
select 'replacewithtablename' into @table;
select 'replacewithdatabasename' into @schema;
select GROUP_CONCAT(r.x SEPARATOR '\n') from
(
select '[DataAccessObject]'as x,'grp'as grp union
select concat('public abstract class ',@table,'{') as x, 'grp' as grp
union
select concat('[PersistedMember]\npublic abstract ',tps.dest,IF(tps.dest = 'string', ' ', IF(is_nullable = 'NO', ' ', '? ')), REPLACE(column_name, ' ', ''),' {get;set;}'), 'grp'
You can’t perform that action at this time.