Skip to content

Instantly share code, notes, and snippets.

View isnifer's full-sized avatar
🏠
Working from home

Anton Kuznetsov isnifer

🏠
Working from home
  • Spicy AI
  • Yerevan, Armenia
  • 05:03 (UTC +04:00)
View GitHub Profile
/** @jsx React.DOM */
var Formsy = require('formsy-react');
var MyOwnInput = React.createClass({
// Add the Formsy Mixin
mixins: [Formsy.Mixin],
// ...
clean: function() {
if (this.cleanedData.password &&
this.cleanedData.confirmPassword &&
this.cleanedData.password != this.cleanedData.confirmPassword) {
throw forms.ValidationError('Passwords do not match.')
}
}
var SignupForm = forms.Form.extend({
username: forms.CharField(),
email: forms.EmailField(),
password: forms.CharField({widget: forms.PasswordInput}),
confirmPassword: forms.CharField({widget: forms.PasswordInput}),
acceptTerms: forms.BooleanField({required: true})
});
var Signup = React.createClass({
render: function() {
return <form onSubmit={this._onSubmit}>
<forms.RenderForm form={SignupForm} ref=”signupForm”/>
<button>Sign Up</button>
</form>
},
// …
@isnifer
isnifer / index.html
Created October 5, 2015 11:55
Krutova html
<html>
<head>
<style>
.text {
font-size: 7px;
color: green;
font-face: 'Monotype Coursiva'
}
</style>
var webpack = require('webpack');
var path = require('path');
var NyanProgressPlugin = require('nyan-progress-webpack-plugin');
module.exports = {
devtool: 'eval',
entry: [
'webpack-dev-server/client?http://localhost:8080',
'webpack/hot/only-dev-server',
'./static/jsx/app.js'
var a = [1, 2, 3, 4, 5];
function add (result, item, index) {
result[index] = item * 2;
return result;
}
function filter (result, item) {
if (item % 3 === 0) {
result.push(item);
import React, { Component } from 'react';
import { bindActionCreators } from 'redux';
import { Connector } from 'redux/react';
import Header from '../components/Header';
import MainSection from '../components/MainSection';
import * as TodoActions from '../actions/TodoActions';
export default class TodoApp extends Component {
render() {
return (
import { Store } from 'flummox';
class MainPageStore extends Store {
constructor (flux) {
super(); // Don't forget this step
const MainPageActionIds = flux.getActionIds('MainPage');
this.register(MainPageActionIds.loadData, this.loadData);
this.register(MainPageActionIds.getTop, this.getTop);
// In React Component
import React from 'react';
import FluxComponent from 'flummox/component';
/* Components */
import GiveawaySearch from '../common/GiveawaySearch';
import Footer from '../common/Footer';
import Content from '../common/Content';
import Container from '../common/Container';