You probably came here because your code is calling your component as a plain function call. This is now deprecated:
var MyComponent = require('MyComponent');
function render() {
return MyComponent({ foo: 'bar' }); // WARNING
> module Main where | |
First, import all the needed modules. | |
> import Text.Parsec hiding (State) | |
> import Text.Parsec.Indent | |
> import Control.Monad.State | |
Next, define our new Parser type. This replaces the Identity monad | |
with the (State SourcePos) monad. |
// This ensures that the automaticallyAdjustsScrollViewInsets magic works | |
// On our newly added view controller as well. | |
// This triggers _layoutViewController which then triggers | |
// _computeAndApplyScrollContentInsetDeltaForViewController: | |
// which finally updates our content inset of the scroll view (if any) | |
// rdar://19053416 | |
[self.navigationController.view setNeedsLayout]; |
Shibboleths. Add these up and if you have an opinion on five - agreeing *or* disagreeing - we’d love to hear from you. Do these elicit strong feelings? See the note at the bottom. | |
- You understand discriminated unions, and how to use the type system to enforce exhaustive checks and other useful patterns. | |
- You can describe good and bad use cases for single page applications. | |
- You can describe why nullable types and a type system that enforces it are advantageous over type systems like Java’s. | |
- You can and have extracted declarative implementations out of imperative code. You know when it’s worth it and when it’s not. |
//! An example demonstrating that glium has a problem using instancing when | |
//! the vertex buffer is a slice with a non-zero starting index. | |
//! | |
#[macro_use] extern crate glium; | |
use glium::{DisplayBuild, Surface}; | |
// Vertex Shader: | |
static VERTEX_SHADER_SRC: &'static str = r#" | |
#version 140 |
import Foundation | |
struct Regex { | |
var pattern: String { | |
didSet { | |
updateRegex() | |
} | |
} | |
var expressionOptions: NSRegularExpressionOptions { | |
didSet { |
//: Playground - noun: a place where people can play | |
import Cocoa | |
import Darwin | |
func htons(value: CUnsignedShort) -> CUnsignedShort { | |
return (value << 8) + (value >> 8) | |
} | |
let INADDR_ANY = in_addr(s_addr: 0) |
if (!!root.EventSource) { | |
/** | |
* This method wraps an EventSource as an observable sequence. | |
* @param {String} url The url of the server-side script. | |
* @param {Observer} [openObserver] An optional observer for the 'open' event for the server side event. | |
* @returns {Observable} An observable sequence which represents the data from a server-side event. | |
*/ | |
dom.fromEventSource = function (url, openObserver) { | |
return new AnonymousObservable(function (observer) { |
defmodule Config do | |
@moduledoc """ | |
This module handles fetching values from the config with some additional niceties | |
""" | |
@doc """ | |
Fetches a value from the config, or from the environment if {:system, "VAR"} | |
is provided. | |
An optional default value can be provided if desired. |
- (void)viewWillAppear:(BOOL)animated | |
{ | |
[super viewWillAppear:animated]; | |
NSIndexPath *selectedRowIndexPath = [self.tableView indexPathForSelectedRow]; | |
if (selectedRowIndexPath) { | |
[self.tableView deselectRowAtIndexPath:selectedRowIndexPath animated:YES]; | |
[[self transitionCoordinator] notifyWhenInteractionEndsUsingBlock:^(id<UIViewControllerTransitionCoordinatorContext> context) { | |
if ([context isCancelled]) { | |
[self.tableView selectRowAtIndexPath:selectedRowIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; |