Skip to content

Instantly share code, notes, and snippets.

View serhei's full-sized avatar

Serhei Makarov serhei

View GitHub Profile
@serhei
serhei / background.py
Last active August 29, 2015 19:05
fairly hideous kuler-based nodebox desktop background (random bubbles)
# A quick desktop background thing using Nodebox and Kuler.
# Requires the Nodebox 'web' plugin.
size (1680, 1050)
gridSize = 10
# Color Scheme taken from Kuler - "Aspirin C"
ximport ("web")
colors, themes = [], web.kuler.search_by_id (251864)
for r, g, b in themes[0]:
@serhei
serhei / backgroundboxes.py
Last active August 29, 2015 19:55
relatively less hideous kuler-based desktop background (rectangular subdivisions)
# Hooray! A desktop background that doesn't burn your eyes out!
# For Nodebox; requires the Web plugin to get colours off kuler.
ximport ("web")
# O Christmas Tree, taken off kuler
colors, themes = [], web.kuler.search_by_id (115618)
for r, g, b in themes[0]:
colors += [color (r, g, b)]
size (1680, 1050)
@serhei
serhei / gist:41826
Last active August 29, 2015 20:34
Rough equivalence between TextMate and XCode selectors.
Rough equivalence between TextMate and XCode selectors.
Derived from http://damieng.com/blog/2008/02/08/humane-theme-for-textmate-and-xcode
Foreground: xcode.syntax.plain
Background: Background
Selection: Selection
Caret: InsertionPoint
comment: xcode.syntax.comment, xcode.syntax.comment.doc, xcode.syntax.comment.doc.keyword
string: xcode.syntax.string, xcode.syntax.character
constant.numeric: xcode.syntax.number
# One-off script I wrote to slurp sample sentences off http://smart.fm
require 'rubygems'
require 'open-uri'
require 'hpricot'
def cleanup_text(str)
# str = str.gsub /<\/?b>/, "" # Human readable
str = str.gsub /\s+/, " "
return str.strip
# The 10,000 Hour Time Tracker, a quick and dirty Nodebox hack.
# Fill in 40 of these pages and attain mastery!
size(850, 1100)
fill(0.5)
translate(15, 20)
font("Helvetica", 35)
size(850, 1100)
# save_footer_row = True # HARDCODE FOR NOW
import calendar, datetime
start_date = datetime.date(2010, 9, 13)
# Compute total_days, days_so_far, numrows, maxpage:
total_days, add_date = 0, start_date

Places to See

'Doors Open' exercises in May -- keep an eye out!

Historical

@serhei
serhei / ctype_examples.md
Last active October 30, 2019 19:54
WIP interesting examples of how C type system is used

(1) Hash table supporting different key types (using a union type)

(2) "Subclassing" a struct by declaring a struct with the same fields and additional data at the end:

In memory:

Good Parks in Toronto

For taking advantage of that 'up to (several) people can meet outside' rule or just spending time in fresh air. I'll gradually gather a list of places to meet people for conversation. Criteria: on the subway, or not too far from it; not too crowded on weekdays; ideally some takeout or coffee nearby.

Central Area:

  • Chorley Park. Long walk from Summerhill Station or short bus ride from Rosedale Station. Not crowded on weekdays. Directly above the well-known Don Valley Brick Works. Nearby coffee on a quiet shopping street.
  • Ramsden Park. On the subway (Rosedale Station). Saw that meetups were hosted there.
  • Christie Pits Park. On the subway (Christie Station), relatively more crowded. Went to a meetup there. Next to Koreatown (many sit-down restaurants, for when those are allowed to open).
  • Not checked yet --