The challenge begins! Don't overthink it. A cub can be made in only a few shapes.
bool _showPassword = false; | |
Widget _buildPasswordTextField() { | |
return TextField( | |
obscureText: !this._showPassword, | |
decoration: InputDecoration( | |
labelText: 'password', | |
prefixIcon: Icon(Icons.security), | |
suffixIcon: IconButton( | |
icon: Icon( |
- play.csssecrets.io/inner-rounding — sqrt
- play.csssecrets.io/diamond-images — sqrt
- play.csssecrets.io/bevel-corners — sqrt
- play.csssecrets.io/folded-corner — sqrt
- play.csssecrets.io/folded-corner-realistic — sqrt, sin, cos
sqrt(2) == cos(45deg) * 2
Zach Caceres
Javascript does not have the typical 'private' and 'public' specifiers of more traditional object oriented languages like C# or Java. However, you can achieve the same effect through the clever application of Javascript's function-level scoping. The Revealing Module pattern is a design pattern for Javascript applications that elegantly solves this problem.
The central principle of the Revealing Module pattern is that all functionality and variables should be hidden unless deliberately exposed.
Let's imagine we have a music application where a musicPlayer.js file handles much of our user's experience. We need to access some methods, but shouldn't be able to mess with other methods or variables.
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works
successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)
A Sass Naming Convention for Sass libraries.
import boto | |
ec2 = boto.connect_ec2() | |
groups = ec2.get_all_security_groups() | |
def get_groups_that_have_ingress_rules_to(groups, group_id): | |
result = [] | |
for group in groups: | |
for rule in group.rules: | |
for grant in rule.grants: |
from .user import User | |
def init_db(db): | |
"""Add a save() function to db.Model""" | |
def save(model): | |
db.session.add(model) | |
db.session.commit() | |
db.Model.save = save |