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 React from 'react'; | |
import { | |
Image, | |
View, | |
Dimensions | |
} from 'react-native'; | |
import messageStyle from './MessageStyles'; | |
class ImageRow extends React.Component { |
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 flatten(arr) { | |
if (!Array.isArray(arr)) throw new Error('flatten takes an array as a parameter'); | |
return arr.reduce(function(newArr, el) { | |
if (Array.isArray(el)) return flatten(newArr.concat(el)); | |
return newArr.concat(el); | |
}, []); | |
} | |
//uses jasmine as a testing framework | |
describe('Flattening an array', function() { |
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 select | |
import socket | |
class EchoServer(object): | |
def __init__(self, reactor): | |
self.sock = socket.socket() | |
self.sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
self.sock.bind(('', 8000)) | |
self.sock.listen(2) |