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.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 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 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 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 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
# This is a skeleton for testing models including examples of validations, callbacks, | |
# scopes, instance & class methods, associations, and more. | |
# Pick and choose what you want, as all models don't NEED to be tested at this depth. | |
# | |
# I'm always eager to hear new tips & suggestions as I'm still new to testing, | |
# so if you have any, please share! | |
# | |
# @kyletcarlson | |
# | |
# This skeleton also assumes you're using the following gems: |
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
## Prepare ################################################################### | |
# Remove RVM | |
rvm implode | |
# Ensure your homebrew is working properly and up to date | |
brew doctor | |
brew update | |
## Install ################################################################### |