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
#!/usr/bin/env python | |
def foo(bar): | |
""" | |
Documentation goes here. | |
""" | |
bar += 1 | |
return bar |
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
def hello(foo): | |
"""Testing Github gist to see how embedding works.""" | |
foo += 5 | |
return foo | |
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
var myCars=["Saab","Volvo","BMW"]; // literal array | |
if (myCars.indexOf("Saab")) { | |
console.log("It's in the list!") | |
} | |
else { | |
console.log("Nope, not there.") | |
} | |
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
<script type="text/javascript"> | |
$(document).ready(function () { | |
$('#uploader').plupload({ | |
runtimes : 'flash,silverlight', | |
url : '{{ s3.url }}', | |
max_file_size : '1000MB', | |
multipart: true, | |
multipart_params: { | |
'key': '{{ s3.key }}', // use filename as a key |
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
@task | |
def temp_resource(foo, bar): | |
""" | |
Generate a temporary resource for use in Tastypie | |
""" | |
value1 = foo**2 | |
value2 = foo * bar | |
return {'field_one': value1, 'field_two': value2} |
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 TempResource(Resource): | |
class Meta: | |
resource_name = 'temp_resource' | |
object_class = temp_resource.delay | |
authorization = Authorization() | |
allowed_methods = ['post', 'get'] | |
always_return_data = True | |
def get_resource_uri(self, bundle_or_obj): | |
""" |
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
local: | |
Data failed to compile: | |
---------- | |
State virtualenv.manage found in sls webserver is unavailable | |
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-pkgs: | |
pkg: | |
- latest | |
- names: | |
- python-virtualenv | |
- python-dev | |
- libmysqlclient-dev | |
- libxml2-dev | |
- mercurial | |
- git |
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
/var/www/env/: | |
virtualenv: | |
- manage | |
- no_site_packages: True | |
- require: | |
- pkg: python-virtualenv | |
python-virtualenv: | |
pkg: | |
- installed |
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
/** | |
* | |
* Base64 encode / decode | |
* http://www.webtoolkit.info/ | |
* | |
**/ | |
var Base64 = { | |
// private property |
OlderNewer