This file contains hidden or 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
<!DOCTYPE html> | |
<head> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0-alpha1/jquery.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-csv/0.71/jquery.csv-0.71.min.js"></script> | |
<script type="text/javascript"> | |
$(document).ready(function() { | |
// The event listener for the file upload | |
document.getElementById('txtFileUpload').addEventListener('change', upload, false); |
This file contains hidden or 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
export default reduxForm({ | |
form: 'signIn', | |
asyncValidate: (values) => { | |
return new Promise((resolve, reject) => { | |
// simulate request | |
setTimeout(() => { | |
if (values.email.indexOf('@gmail.com') === -1) { | |
reject({ email: 'Only mails at gmail are allowed' }); | |
} else { | |
resolve(); |
This file contains hidden or 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 { reduxForm, Field } from 'redux-form'; | |
import { ScrollView, Text, TouchableOpacity } from 'react-native'; | |
import moment from 'moment'; | |
import MyTextInput from './MyTextInput'; | |
/** | |
* Automatically adds the dashes required by the specified phone format and limits the input to ten characters | |
*/ |
This file contains hidden or 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 co from 'co'; | |
app.post("/purchase", (req, res) => { | |
co(function* () { | |
const person = yield user.findOneAsync(req.body); | |
const permissions = yield permissions.findAllAsync(person); | |
if (isAllowed(permissions)) { | |
const confirmNum = yield transaction.processAsync(user); | |
res.send("Your transaction was successful!") | |
} | |
}).catch(err => handleError(err)) |
This file contains hidden or 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 re | |
import sys | |
from subprocess import Popen, PIPE | |
from multiprocessing import Pool | |
PDS_BASE = 'http://aws-publicdatasets.s3.amazonaws.com/' | |
WARC_PATHS = { | |
'2014-12': 'common-crawl/crawl-data/CC-MAIN-2014-52/warc.paths.gz', | |
'2015-07': 'common-crawl/crawl-data/CC-MAIN-2015-32/warc.paths.gz' |
NewerOlder