Skip to content

Instantly share code, notes, and snippets.

@damonjones
damonjones / composer.json
Created Sep 10, 2015
Extract from composer.son
View composer.json
"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 Sep 10, 2015
Framework section from the app/config/config.yml
View 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 Jan 25, 2017
Pitcher Shifter test (Swift)
View 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 Aug 29, 2015
Pitch Shifter test
View 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) {
View Check for iPhone 3.5",4",4.7" or 5.5"
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");
View Lazy Instantiation
#import "Bar.h"
@implementation Bar
@synthesize foo = _foo;
- (Foo *)foo {
if (nil == _foo) {
_foo = [[Foo alloc] init];
}
View keybase.md

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 Nov 20, 2013
UPC/EAN Validator
View UpcEan.php
<?php
namespace Insig\UtilBundle\Validator\Constraints;
use Symfony\Component\Validator\Constraint;
/**
* Metadata for the UpcEanValidator.
*
* @Annotation