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
AVCaptureVideoDataOutput *videoOutput = [[AVCaptureVideoDataOutput alloc] init]; | |
NSDictionary *formats = [NSDictionary dictionaryWithObjectsAndKeys: | |
@"kCVPixelFormatType_1Monochrome", [NSNumber numberWithInt:kCVPixelFormatType_1Monochrome], | |
@"kCVPixelFormatType_2Indexed", [NSNumber numberWithInt:kCVPixelFormatType_2Indexed], | |
@"kCVPixelFormatType_4Indexed", [NSNumber numberWithInt:kCVPixelFormatType_4Indexed], | |
@"kCVPixelFormatType_8Indexed", [NSNumber numberWithInt:kCVPixelFormatType_8Indexed], | |
@"kCVPixelFormatType_1IndexedGray_WhiteIsZero", [NSNumber numberWithInt:kCVPixelFormatType_1IndexedGray_WhiteIsZero], | |
@"kCVPixelFormatType_2IndexedGray_WhiteIsZero", [NSNumber numberWithInt:kCVPixelFormatType_2IndexedGray_WhiteIsZero], | |
@"kCVPixelFormatType_4IndexedGray_WhiteIsZero", [NSNumber numberWithInt:kCVPixelFormatType_4IndexedGray_WhiteIsZero], |
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
2016/08/05 17:25:50 [INFO] Terraform version: 0.7.0 e822a79165dbc06bbf8271ee349fe256867d53dc | |
2016/08/05 17:25:50 [DEBUG] Detected home directory from env var: /Users/andrew | |
2016/08/05 17:25:50 [DEBUG] Detected home directory from env var: /Users/andrew | |
2016/08/05 17:25:50 [DEBUG] Attempting to open CLI config file: /Users/andrew/.terraformrc | |
2016/08/05 17:25:50 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. | |
2016/08/05 17:25:50 [DEBUG] Detected home directory from env var: /Users/andrew | |
2016/08/05 17:25:50 [TRACE] Graph after step *terraform.ConfigTransformer: | |
module.howard_production_elb2elk - *terraform.GraphNodeConfigModule | |
var.region - *terraform.GraphNodeConfigVariable |
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/local/bin/bash | |
export DOMAIN_NAME=$1 | |
export PROFILE_NAME=$2 | |
if [ -z "$3" ]; then | |
export CERTIFICATE_NAME=$(echo $DOMAIN_NAME | sed -e 's/\*/wildcard/g') | |
else | |
export CERTIFICATE_NAME=$3 | |
fi | |
echo $CERTIFICATE_NAME | |
aws iam upload-server-certificate --server-certificate-name $CERTIFICATE_NAME$(date +"-%Y-%m-%d") --certificate-body file://$DOMAIN_NAME.crt --private-key file://$DOMAIN_NAME.key --certificate-chain file://$DOMAIN_NAME.chain.crt --profile $PROFILE_NAME # --path /cloudfront/ |
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 SpanWidget(forms.Widget): | |
""" | |
Renders a value wrapped in a <span> tag. | |
Based on Killarny, http://www.djangosnippets.org/snippets/1340/ | |
Modified to place the value in a hidden control, so that it | |
returns a value in the GET/POST response. | |
""" | |
def __init__(self, attrs=None, choices=(), url=False): | |
super(SpanWidget, self).__init__(attrs=attrs) | |
self.url = url |
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 import simplejson as json | |
from piston.decorator import decorator | |
def validate_json(form_class, class_method=True): | |
@decorator | |
def wrap(f, *args, **kwargs): | |
if class_method: | |
request = args[1] |
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
sudo bash < <(curl https://raw.github.com/gist/1737523/puppet-install.sh ) |
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 import forms | |
TIME_CHOICES = [('', '--------')] | |
for i in range(0, 24): | |
for m in ["00", "30"]: | |
hour = i % 12 | |
if i == 12: | |
hour = 12 | |
TIME_CHOICES.append( | |
("%02d:%s" % (i, m), |
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 os.path | |
PROJECT_ROOT = os.path.abspath(os.path.dirname(os.path.realpath(__file__))) | |
# Absolute filesystem path to the directory that will hold user-uploaded files. | |
# Example: "/home/media/media.lawrence.com/media/" | |
MEDIA_ROOT = os.path.join(PROJECT_ROOT, 'site_media', 'media') | |
# URL that handles the media served from MEDIA_ROOT. Make sure to use a | |
# trailing slash. | |
# Examples: "http://media.lawrence.com/media/", "http://example.com/media/" |
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
(function(){ | |
var url = new String(window.location); | |
window.location = url.replace(".marpasoft", "").replace("imported-", ""); | |
})(); |
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
for i in $(find . -name '*.as' -exec file '{}' \; | | |
grep 'with CR line terminators' | | |
sed 's/:.*//g'); do | |
echo $i; | |
perl -pi -e 's/\r/\n/g;' "$i"; | |
done |
NewerOlder