Skip to content

Instantly share code, notes, and snippets.

View evillemez's full-sized avatar

Evan Villemez evillemez

  • Global Professional Search
  • Washington, DC
View GitHub Profile
@evillemez
evillemez / .gitignore
Created September 29, 2011 00:46
GIT Ignore for Unity
Temp/
Library/
obj/
*.svd
!Library/*.asset
!Library/AssetImportState
!Library/AssetVersioning.db
!Library/BuildPlayer.prefs
!Library/ScriptMapper
@evillemez
evillemez / gist:6464513
Last active March 4, 2018 08:27
A better way to illustrate an example RESTful server in PHP for a demo with angular.js.
@evillemez
evillemez / gist:8024315
Created December 18, 2013 15:32
On deploying apps w/ Symfony and Angular.js

Project Deployment with Symfony2 & Angular.js

Symfony2 and Angular.js make a great, robust combintaion. Integrating them isn't immediately obvious, however. Both communities come with their own standards and suite of tools for managing the development process, and sometimes those tools conflict.

On the Symfony side, you mainly deal with composer for managing your dependencies, a few Symfony commands in your project, and any other tools you add into the mix, like phpunit.

On the Angular side, you'll probably end up using npm, bower and probably grunt for automating some of the pain.

The short answer

@evillemez
evillemez / gist:8735382
Last active August 29, 2015 13:55
traits, magic methods and inheritance
<?php
trait Methods
{
public function __call($name, $args)
{
if (property_exists($this, $name)) {
return $this->$name;
}
@evillemez
evillemez / gist:9667390
Created March 20, 2014 16:09
Idea for generating fixtures - this is generation only, not about persistence
<?php
namespace AC\Fixtures;
/**
* Factories use Definitions and Pools to create and store (not persist) object instances.
*/
interface Factory
{
public function define($name); //create and returns Definition
@evillemez
evillemez / gist:9858646
Created March 29, 2014 17:34
anonymous functions and stuff
var logSomething = function(something) {
console.log(something);
};
function do_math(foo, bar, baz) {
return foo + bar + baz;
};
function do_math_then(foo, bar, baz) {
@evillemez
evillemez / gist:9859256
Created March 29, 2014 18:07
getting file contents in node/php

Logging the contents of a file, and printing some random stuff:

JS (in node):

var fs = require('fs');

fs.readFile('/foo.txt', function(contents) {
	console.log(contents);
});
setTimeout(function() {
console.log("2 seconds");
}, 2000);
setTimeout(function() {
console.log("now??");
}, 0);
console.log("now");
@evillemez
evillemez / fixtures.php
Created April 4, 2014 17:39
Brainstorming for a very small fixture generation library.
<?php
namespace AC\Fixtures;
/**
* Factories use Definitions and Pools to create and store (not persist) object instances.
*/
interface Factory
{
public function define($name); //create and returns Definition
@evillemez
evillemez / interfaces.php
Created April 29, 2014 19:21
Prototype interfaces for a simpler Authentication framework.
<?php
namespace AC\Authentication;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;