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
import warnings | |
from troposphere import Template as BaseTemplate, BaseAWSObject, Ref, AWSHelperFn | |
from troposphere import ( | |
AWS_ACCOUNT_ID, | |
AWS_NOTIFICATION_ARNS, | |
AWS_NO_VALUE, | |
AWS_REGION, | |
AWS_STACK_ID, |
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
import subprocess | |
from contextlib import contextmanager | |
from mock import Mock, MagicMock | |
@contextmanager | |
def popen_mock(): | |
""" | |
Context manager to mock subprocess calls. |
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 tastypie.fields import CharField | |
from tastypie.exceptions import ApiFieldError | |
class CommaSeparatedIntegerField(CharField): | |
""" | |
Converts django's string field to and from a list | |
""" | |
def dehydrate(self, bundle, for_list=True): | |
value = getattr(bundle.obj, self.attribute, None) |
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 http = require('http'); | |
var io = require('socket.io'); | |
var sys = require('sys'); | |
var amqp = require('amqp'); | |
server = http.createServer(function(req, res){ | |
res.writeHead(200, {'Content-Type': 'text/html'}); | |
res.end('<h1>Hello world</h1>'); | |
}); |
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
package com.example.listview; | |
import java.util.ArrayList; | |
import android.content.Context; | |
import android.view.LayoutInflater; | |
import android.view.View; | |
import android.view.ViewGroup; | |
import android.widget.ArrayAdapter; | |
import android.widget.ImageView; | |
import android.widget.TextView; |
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
/* | |
* Copyright 2011, Manuel Zapata | |
*/ | |
// Import the sonia lib | |
import pitaru.sonia_v2_9.*; | |
// Vector to store the glow of each point | |
int[] glow; |