This file contains 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
/* @flow */ | |
type IdentityFunc<A> = (a: A) => A; | |
declare var identity: IdentityFunc<number>; | |
const aNumber:number = identity(1); | |
const aString:string = identity("foo"); |
This file contains 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
function identity(a) { | |
return a; | |
} |
This file contains 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
import {connect} from 'react-redux'; | |
// redux and react-redux are great! Let's create a connected component that looks up firstName in the state | |
// note that the age prop still needs to be supplied to ConnectedWhatsMyAgeAgain | |
const ConnectedWhatsMyAgeAgain = connect( | |
(state:{user:{name:string}}) => ({ | |
firstName: state.user.name.split(' ')[0], | |
}) | |
)(WhatsMyAgeAgain); | |
function App() { |
This file contains 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
#!/usr/bin/env python | |
import os | |
import os.path | |
import json | |
import re | |
from mimetypes import guess_type | |
from optparse import OptionParser | |
SUPPORTED_TYPES = ('image/gif','image/jpeg','image/png','image/bmp','image/tiff') |
This file contains 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
#!/usr/bin/python2.6 | |
import os.path | |
import json | |
import urllib2 | |
import BaseHTTPServer | |
import webbrowser | |
from urlparse import urlparse, parse_qs | |
from urllib import urlencode |
NewerOlder