- Making lists with stuff in them
- access just like strings!
- O-indexed
- assignment with
list[index]
syntax, touch on mutability ("this can be changed, strings can't")
// @flow | |
type A = { | |
lower: 'a' | |
} | |
type B = { | |
lower: 'b', | |
bMethod: Function | |
} |
class GCFixedColumnHorizontalScrollingCollectionViewFlowLayout: UICollectionViewFlowLayout { | |
var numberOfRows: UInt = 0 | |
var numberOfFixedColumns: UInt = 0 | |
var columnWidth: UInt = 0 | |
init(numberOfFixedColumns: UInt, columnWidth: UInt) { | |
self.numberOfFixedColumns = numberOfFixedColumns | |
self.columnWidth = columnWidth | |
super.init() | |
self.scrollDirection = .Horizontal |
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"github.com/codegangsta/martini-contrib/binding" | |
"github.com/go-martini/martini" | |
"github.com/shopify/sarama" | |
"net/http" | |
) |
package main | |
import ( | |
"fmt" | |
"github.com/codegangsta/martini-contrib/binding" | |
"github.com/go-martini/martini" | |
"gopkg.in/mgo.v2" | |
"gopkg.in/mgo.v2/bson" | |
"net/http" | |
) |
app.all '/push/*', (request, response) -> | |
response.json 503, {} | |
app.get '/api/v2/user_messages', (request, response) -> | |
response.json 200, {messages: [{message_heading: 'Scheduled Maintenance', message_text: 'We are currently conducting maintenance'}]} # in-app messaging! | |
app.all '/api/*', (request, response) -> | |
response.json 503, {} | |
app.all '/*', (request, response) -> | |
response.setHeader 'Retry-After', '3600' | |
response.send 503, render503Page() # renders html for web 503 page |
{ | |
"dependencies": { | |
"johnny-five": "git+ssh://[email protected]:rwldrn/johnny-five.git" | |
} | |
} |
red="\[\e[0;31m\]" | |
green="\[\e[0;32m\]" | |
yellow="\[\e[0;33m\]" | |
purple="\[\e[0;35m\]" | |
cyan="\[\e[0;36m\]" | |
end="\[\e[0m\]" | |
#curl https://raw.github.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash | |
if [ -f ~/.git-completion.bash ] | |
then |
from collections import defaultdict | |
import functools | |
class Registry(object): | |
def __init__(self): | |
self.dispatchers = {} | |
self.functions = defaultdict(dict) | |
def __enter__(self): |
from collections import defaultdict | |
import functools | |
class multimethod(object): | |
""" | |
multimethod.register('function', dispatcher) | |
@multimethod.register('function') | |
def dispatcher(): pass |