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
from django.core.exceptions import ValidationError | |
from django.shortcuts import get_object_or_404 | |
from rest_framework import status | |
from rest_framework.response import Response | |
from rest_framework.views import APIView | |
from v1.accounts.models.profile import Profile | |
from v1.accounts.models.user import User | |
from v1.accounts.serializers.user import UserSerializer, UserSerializerCreate, UserSerializerLogin, UserSerializerUpdate | |
from v1.credits.models.invitation import Invitation | |
from v1.utils import constants |
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 CommentSerializer(serializers.Serializer): | |
email = serializers.EmailField() | |
content = serializers.CharField(max_length=200) | |
created = serializers.DateTimeField() | |
def create(self, validated_data): | |
return Comment.objects.create(**validated_data) | |
def update(self, instance, validated_data): | |
instance.email = validated_data.get('email', instance.email) |
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 axios from 'axios'; | |
import {normalize} from 'normalizr'; | |
import actionTypes from '../../../config/action-types'; | |
import settings from '../../../config/settings'; | |
import {setNormalized, stringify} from '../../../utils/general'; | |
import {POST} from '../../../utils/normalize'; | |
import {tokenHeader} from '../../../utils/requestHeaders'; | |
export const getPostList = (params = {}) => async dispatch => { |
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, {Component} from 'react'; | |
import {connect} from 'react-redux'; | |
import {Field, reduxForm, reset} from 'redux-form'; | |
import PropTypes from 'prop-types'; | |
import {createPostReply} from '../../actions/replies/post-reply/create'; | |
import FormStatus from '../../components/FormStatus'; | |
import {renderTextArea} from '../../utils/redux-form-fields'; | |
class PostReplyForm extends 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
import omit from 'lodash/omit'; | |
export default function createModelReducer(modelName, INITIAL_STATE = {}) { | |
return (state = INITIAL_STATE, action) => { | |
switch(action.type) { | |
case `SET_${modelName}_SUCCESS`: | |
return { | |
...state, |
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
// Allow CSS transitions when page is loaded | |
$(window).on('load', function() { | |
$('body').removeClass('no-transitions'); | |
}); | |
$(function() { | |
// Disable CSS transitions on page load | |
$('body').addClass('no-transitions'); |
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
if __name__ == '__main__': | |
for i in range(1, 101): | |
if i % 3 == 0 and i % 5 == 0: | |
print('FizzBuzz') | |
continue | |
elif i % 3 == 0: | |
print('Fizz') | |
continue | |
elif i % 5 == 0: | |
print('Buzz') |
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
# -*- coding: utf-8 -*- | |
# Generated by Django 1.11.1 on 2017-09-26 21:10 | |
from __future__ import unicode_literals | |
from django.db import migrations, models | |
class Migration(migrations.Migration): | |
dependencies = [ |
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
{ | |
"0cdd4ba04456ca169baca3d66eace869520c62fe84421329086e03d91a68acdb": { | |
"balance": "4294967296.0000000000000000", | |
"balance_lock": "0cdd4ba04456ca169baca3d66eace869520c62fe84421329086e03d91a68acdb" | |
} | |
} |
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
{ | |
"app": { | |
"accounts": {}, | |
"banks": { | |
"d5356888dc9303e44ce52b1e06c3165a7759b9df1e6a6dfbd33ee1c3df1ab4d1": { | |
"nickname": "My awesome bank" | |
} | |
}, | |
"friends": {}, | |
"validators": {} |
OlderNewer