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
| from django.utils.text import compress_string | |
| from django.core.serializers.json import DjangoJSONEncoder | |
| class CompressedBinaryField(models.BinaryField): | |
| compress = compress_string | |
| @staticmethod | |
| def uncompress(s): | |
| zbuf = io.BytesIO(s) |
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
| // At top, import immutable | |
| import { Map } from 'immutable'; | |
| // Later, in constructor... | |
| this.state = { | |
| // Create an immutable map in state using immutable.js | |
| user: Map({ firstName: 'Cory', lastName: 'House'}) | |
| }; | |
| updateState({target}) { |
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
| # concepts/account/cell.rb | |
| class Account::Cell < Cell:Concept | |
| ... | |
| def show | |
| render | |
| end | |
| class Grid < Cell::Concept | |
| def show |
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
| <?php | |
| namespace MyProject\UserBundle\Form\Type; | |
| use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType; | |
| use FOS\UserBundle\Model\UserManager; | |
| use Symfony\Component\Form\FormBuilderInterface; | |
| use Symfony\Component\Form\FormEvent; | |
| use Symfony\Component\Form\FormEvents; | |
| use Symfony\Component\OptionsResolver\OptionsResolverInterface; | |
| use MyProject\UserBundle\Entity\User; |
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
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |