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 import forms | |
| class BootstrapCharField(forms.CharField): | |
| def __init__(self, *args, **kwargs): | |
| # Grab the placeholder from the kwargs if it exists | |
| placeholder = kwargs.pop('placeholder') if 'placeholder' in kwargs else u'' | |
| # Build all the defaults | |
| super(BootstrapCharField, self).__init__(*args, **kwargs) |
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
| # --------------------------------------------------------------------------- | |
| # | |
| # Description: This file holds all my BASH configurations and aliases | |
| # | |
| # Sections: | |
| # 1. Environment Configuration | |
| # 2. Make Terminal Better (remapping defaults and adding functionality) | |
| # 3. File and Folder Management | |
| # 4. Searching | |
| # 5. Process Management |
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
| set user to "USERNAME" | |
| set pass to "PASSWORD" | |
| --set token automatically based on macaddress | |
| set macAddHash to do shell script "/sbin/ifconfig en0 | /usr/bin/awk '/ether / {print $2}' | /usr/bin/tr -d ':' | md5 " | |
| try | |
| set vpn_ip to do shell script "ifconfig tun0 | grep inet | awk '{print $2}'" | |
| --hack: must delete property before writing it but first run 'defaults delete' fails |
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
| Basics | |
| ====== | |
| Expansion (special symbols replaced by values) and word splitting (arguments being split into several aruments) must have attemtion paid or pain will follow. | |
| - # for comments | |
| - Lots of internal variables available to bash scripts, see: http://tldp.org/LDP/abs/html/internalvariables.html#ARGLIST | |
| - Name of script will be $0 | |
| - Parameters passed to script will be in $1, $2, $3.... vars and count in $# |
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
| var animal = { | |
| name: 'Karl', | |
| type: 'cat', | |
| color: 'black', | |
| age: 7 | |
| }; | |
| //convert JSON animal into a string | |
| var dehydratedAnimal = JSON.stringify(animal); |
NewerOlder