This file contains hidden or 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
+ (UIImage *)imageFromText:(NSString *)text size:(CGSize)size fontName:(NSString *)fontName maxFontSize:(CGFloat)maxFontSize minFontSize:(CGFloat)minFontSize | |
{ | |
UIFont *font; | |
CGSize fontSize; | |
for (CGFloat maxSize = maxFontSize; maxSize >= minFontSize; maxSize -= 1.f) { | |
font = [UIFont fontWithName:fontName size:maxSize]; | |
fontSize = [text sizeWithAttributes:@{ NSFontAttributeName : font }]; | |
if (fontSize.width <= size.width) { |
This file contains hidden or 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
{% extends "base.html" %} | |
{% block content %} | |
<section title="Child Create" data-role="content"> | |
<h2>Child Create</h2> | |
<form action="{% url child_create slug=form.family_slug.value %}" method="POST"> | |
{{ form.errors }} | |
{% csrf_token %} | |
<ul> |
This file contains hidden or 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
"""Simple TCP server for playing Tic-Tac-Toe game. | |
Use Player-to-Player game mode based on naming auth. | |
No thoughts about distribution or pub/sub mode | |
(for monitoring or something like this). Just | |
basic functionality. | |
""" | |
import time | |
import logging |