Skip to content

Instantly share code, notes, and snippets.

@damonjones
damonjones / composer.json
Created September 10, 2015 10:01
Extract from composer.son
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.7.*",
"doctrine/orm": "~2.2,>=2.2.3,<2.5",
"doctrine/dbal": "<2.5",
"doctrine/doctrine-bundle": "~1.4",
"doctrine/doctrine-fixtures-bundle": "^2.2",
"doctrine/data-fixtures": "^1.1",
"twig/extensions": "~1.3",
"symfony/assetic-bundle": "~2.3",
@damonjones
damonjones / config.yml
Created September 10, 2015 09:46
Framework section from the app/config/config.yml
framework:
#esi: ~
translator: { fallback: %locale% }
secret: %secret%
router:
resource: "%kernel.root_dir%/config/routing.yml"
strict_requirements: %kernel.debug%
form: true
csrf_protection: true
validation: { enable_annotations: true }
@damonjones
damonjones / Pitcher Shifter test (Swift)
Last active January 25, 2017 15:50
Pitcher Shifter test (Swift)
//
// ViewController.swift
// PitcherShifterSwift
//
// Created by Damon Jones on 11/9/14.
// Copyright (c) 2014 Damon Jones. All rights reserved.
//
import UIKit
import AVFoundation
@damonjones
damonjones / Pitch Shifter test
Last active August 29, 2015 14:09
Pitch Shifter test
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
NSError *error = nil;
// Get the URL of the file
NSURL *url = [[NSBundle mainBundle] URLForResource:@"Audio File" withExtension:@"m4a"];
if (!url) {
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) {
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
NSLog(@"Device is iPhone 4");
}
if(result.height == 568)
{
NSLog(@"Device is iPhone 5s");
#import "Bar.h"
@implementation Bar
@synthesize foo = _foo;
- (Foo *)foo {
if (nil == _foo) {
_foo = [[Foo alloc] init];
}

Keybase proof

I hereby claim:

  • I am damonjones on github.
  • I am DamonJones (https://keybase.io/DamonJones) on keybase.
  • I have a public key whose fingerprint is CD7E F4A7 6D14 8E08 D88C 970F 90E9 5DF1 0369 CFCB

To claim this, I am signing this object:

@damonjones
damonjones / UpcEan.php
Created November 20, 2013 17:10
UPC/EAN Validator
<?php
namespace Insig\UtilBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
/**
* Metadata for the UpcEanValidator.
*
* @Annotation