Skip to content

Instantly share code, notes, and snippets.

View benglass's full-sized avatar

Ben Glassman benglass

View GitHub Profile
watch: {
src: {
files: '<%= jshint.core.src %>',
tasks: ['jshint:src', 'qunit', 'concat']
},
test: {
files: '<%= jshint.test.src %>',
tasks: ['jshint:test', 'qunit']
},
less: {
<li class="promo-code">
<label for="ctl00_cphMain_txtPromoCode" id="ctl00_cphMain_lblPromoCode">
If you have a promo code for this class,<br />please enter it here:
</label>
<input name="ctl00$cphMain$txtPromoCode" type="text" id="ctl00_cphMain_txtPromoCode" class="promo-code-field" />
</li>
less: {
compileMaster: {
options: {
strictMath: true,
sourceMap: true,
outputSourceFiles: true,
sourceMapURL: 'master.css.map',
sourceMapFilename: 'dist/css/master.css.map'
},
src: 'less/master.less',
<?php
class PostController
{
public function publishAction(Post $post)
{
$this->postManager->publish($post);
return $this->redirectTo('post_edit', array('id' => $post->getId()));
{
sinks: {
"boom_box": {
"wattage": "8",
"standby_wattage": "5.2",
"name": "Boom Box",
"categories": ["home_entertainment"]
}
},
categories: {
<?php
var_dump($argv);
$testMode = isset($argv[1]);
if ($testMode) {
die('testMode!');
}
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div id="foo">My foo</div>
<iframe src="testiframe.html" width="100%" height="400"></iframe>
</body>
<?php
$cacheStore = new Symfony\Component\HttpKernel\HttpCache\Store('/path/to/app/cache/prod/http_cache');
$cacheStore->purge('http://www.foo.com/my/url');
<?php
$em = $container->get('doctrine.orm.default_entity_manager');
$repo = $em->getRepository('VDWVTFABundle:Organization');
$org = $repo->findOneByName('Vermont Sustainable Jobs Fund');
$org->setName('HAHAHA BAD CRAP');
$em->flush();
<?php
class TransformerAbstract
{
private $fields;
private $allowedFields = array('id', 'name', 'phone', 'email', 'bio', 'num_friends');
private $partialFields = array(
'id' => array('id', 'name'),
'info' => array('name', 'phone', 'email', 'bio'),
'bio' => array('bio')