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
angular.module('App', ['ngRoute']) | |
.run(function(repositories) { | |
//ensure that request is sent on application start, you could also | |
//call load() on route.resolve() depending on your needs | |
repositories.load(); | |
}) | |
.config(function($routeProvider) { | |
$routeProvider | |
.when('/', { | |
resolve: { |
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
<?php | |
namespace MyBundle\TestBundle\Lib; | |
use Doctrine\ORM\EntityManager; | |
use \Symfony\Bundle\FrameworkBundle\Test\WebTestCase; | |
/** | |
* Helper class to help manager transaction for each test, | |
* database needs to be initialized once before whole test suite |
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
<?php | |
// app/test.bootstrap.php | |
if (isset($_ENV['BOOTSTRAP_CLEAR_CACHE_ENV'])) { | |
passthru(sprintf( | |
'php "%s/console" cache:clear --env=%s --no-warmup', | |
__DIR__, | |
$_ENV['BOOTSTRAP_CLEAR_CACHE_ENV'] | |
)); | |
} |
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
<!-- pom.xml, adding required dependency--> | |
<dependencies> | |
<dependency> | |
<groupId>com.thetransactioncompany</groupId> | |
<artifactId>cors-filter</artifactId> | |
<version>1.3.2</version> | |
</dependency> | |
</dependencies> |
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
//Allowing CORS (Cross-Origin Resource Sharing) requests from | |
// grunt server, put this into Gruntfile.js | |
grunt.initConfig({ | |
connect: { | |
livereload: { | |
options: { | |
port: 9000, | |
hostname: 'localhost', | |
middleware: function (connect) { | |
return [ |
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/bin/python | |
# Simple python script that takes a html file extracts all scripts and concatenates them into | |
# a single file. The concatenated script is then sent to the google closure compiler for further | |
# squishing. | |
# Finally a game.zip archive is created with all specified files. The size of this archive | |
# is printed to standard output | |
# | |
# Usage: | |
# In the terminal type: |
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 parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>#{get 'title' /}</title> | |
<meta charset="${_response_encoding}"> | |
<link rel="stylesheet" media="screen" href="@{'/public/stylesheets/main.css'}"> | |
#{get 'moreStyles' /} | |
<link rel="shortcut icon" type="image/png" href="@{'/public/images/favicon.png'}"> | |
<script src="@{'/public/javascripts/jquery-1.5.2.min.js'}" type="text/javascript" charset="${_response_encoding}"></script> |
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 tags; | |
import groovy.lang.Closure; | |
import java.io.PrintWriter; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
import models.MenuItem; |
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
#{if !menuItems.isEmpty()} | |
<ul> | |
#{list items:menuItems, as: 'item'} | |
<li>${item.name}</li> | |
#{/list} | |
</ul> | |
#{/if} |
NewerOlder