Skip to content

Instantly share code, notes, and snippets.

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() {
@pcardune
pcardune / download_page_photos.py
Created November 2, 2011 05:05
Download Facebook Page Photos
#!/usr/bin/env python
import os.path
import os
from urllib import urlretrieve
import imp
print "starting up, hang with me..."
urlretrieve('https://raw.github.com/facebook/fbconsole/master/src/fbconsole.py',
@pcardune
pcardune / upload_photos.py
Created September 5, 2011 22:07
Script to upload a bunch of photos to facebook
#!/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')
@pcardune
pcardune / .gitignore
Created September 5, 2011 04:55
Facebook command-line client helper
.fb_access_token
.fbconsole.py
@pcardune
pcardune / feed_me.py
Created September 2, 2011 04:47
Authenticate with Facebook on the Command Line
#!/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