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 express from 'express'; | |
import bodyParser from 'body-parser'; | |
const app = express(); | |
app.use(bodyParser.json()); // add a middleware (so that express can parse request.body's json) | |
app.post('/api/courses', (request, response) => { | |
response.json(request.body); | |
}); |
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
JVBERi0xLjMKMSAwIG9iago8PCAvVHlwZSAvQ2F0YWxvZwovT3V0bGluZXMgMiAwIFIKL1BhZ2VzIDMgMCBSID4+CmVuZG9iagoyIDAgb2JqCjw8IC9UeXBlIC9PdXRsaW5lcyAvQ291bnQgMCA+PgplbmRvYmoKMyAwIG9iago8PCAvVHlwZSAvUGFnZXMKL0tpZHMgWzYgMCBSCl0KL0NvdW50IDEKL1Jlc291cmNlcyA8PAovUHJvY1NldCA0IDAgUgovRm9udCA8PCAKL0YxIDggMCBSCj4+Cj4+Ci9NZWRpYUJveCBbMC4wMDAgMC4wMDAgNjEyLjAwMCA3OTIuMDAwXQogPj4KZW5kb2JqCjQgMCBvYmoKWy9QREYgL1RleHQgXQplbmRvYmoKNSAwIG9iago8PAovQ3JlYXRvciAoRE9NUERGKQovQ3JlYXRpb25EYXRlIChEOjIwMTUwNzIwMTMzMzIzKzAyJzAwJykKL01vZERhdGUgKEQ6MjAxNTA3MjAxMzMzMjMrMDInMDAnKQo+PgplbmRvYmoKNiAwIG9iago8PCAvVHlwZSAvUGFnZQovUGFyZW50IDMgMCBSCi9Db250ZW50cyA3IDAgUgo+PgplbmRvYmoKNyAwIG9iago8PCAvRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDY2ID4+CnN0cmVhbQp4nOMy0DMwMFBAJovSuZxCFIxN9AwMzRTMDS31DCxNFUJSFPTdDBWMgKIKIWkKCtEaIanFJZqxCiFeCq4hAO4PD0MKZW5kc3RyZWFtCmVuZG9iago4IDAgb2JqCjw8IC9UeXBlIC9Gb250Ci9TdWJ0eXBlIC9UeXBlMQovTmFtZSAvRjEKL0Jhc2VGb250IC9UaW1lcy1Cb2xkCi9FbmNvZGluZyAvV2luQW5zaUVuY29kaW5nCj4+CmVuZG9iagp4cmVmCjAgOQowMDAwMDAwMDAwIDY1NTM1IGYgCjAwMDAwMDAwMDggMDAw |
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 Player(name){ | |
this.name = name; | |
} | |
Player.prototype.onLoaded = () => {}; | |
Player.prototype.on = function (eventName, callback) { | |
if (eventName === 'loaded') { | |
this.onLoaded = callback; | |
} | |
}; | |
Player.prototype.load = 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
body { | |
position: relative; | |
top: -928px; | |
left: -1076px; | |
color: #373737; | |
font-family: Arial, sans-serif; | |
font-size: 17px; | |
line-height: 24px; | |
max-width: 100%; | |
width: 100% !important; |
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
class UserBillingInfo(models.Model): | |
user = models.OneToOneField(User, unique=True) | |
payment_token = models.CharField(max_length = 20) | |
is_current = models.BooleanField(default = False) | |
active_until = models.DateField( default=datetime.now()+timedelta(days=365), null=True, blank=True ) | |
billing_phone = models.DecimalField(default=0, max_digits=12, decimal_places=0) | |
billing_address = models.CharField(max_length = 160) | |
billing_city = models.CharField(max_length = 38) | |
billing_zip = models.PositiveIntegerField(default = 0) | |
billing_state = models.CharField(max_length = 2) |
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
/dashboard-modules/1 - |
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
SELECT COUNT(MOVIES.ID), MOVIES.DIRECTOR | |
FROM MOVIES | |
GROUP BY MOVIES.DIRECTOR | |
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 TusJsClient from 'tus-js-client'; | |
const TRANSLOADIT_AUTH_KEY = 'bbbb889ccccc211e984444d105c7e04b7'; | |
const createAssembly = (uniqueAwsS3Path) => { | |
const formData = new FormData(); | |
formData.append('params', JSON.stringify({ | |
auth: { | |
key: TRANSLOADIT_AUTH_KEY | |
}, |
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 TransloaditApi from './TransloaditApi'; | |
const AWS_S3_URL_PREFIX = 'https://memcode.s3.amazonaws.com/'; | |
const onFileDrop = (event) => { | |
const file = event.target.files[0]; | |
// 1. Generate unique AWS S3 path | |
const uniqueAwsS3Path = 'randomFilename.someExtension'; | |
// 2. Create Transloadit assembly |
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
// focus - focusOptions - preventScroll polyfill | |
const isPreventScrollDefined = () => { | |
let supportsPreventScrollOption = false | |
// 1. Create element | |
const el = document.createElement('div') | |
// 2. Make sure it won't do anything on focus | |
el.addEventListener('focus', (event) => { |
OlderNewer