Skip to content

Instantly share code, notes, and snippets.

@jeremymarc
jeremymarc / capybara cheat sheet
Last active August 29, 2015 14:25 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@jeremymarc
jeremymarc / backbone.rails.js
Created April 29, 2011 16:18 — forked from trydionel/backbone.rails.js
Makes Backbone.js play nicely with default Rails setup
//
// Backbone.Rails.js
//
// Makes Backbone.js play nicely with the default Rails setup, i.e.,
// no need to set
// ActiveRecord::Base.include_root_in_json = false
// and build all of your models directly from `params` rather than
// `params[:model]`.
//
// Load this file after backbone.js and before your application JS.
@jeremymarc
jeremymarc / hack.sh
Created April 6, 2012 18:25 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
@jeremymarc
jeremymarc / BaseModelManager.php
Created April 26, 2012 18:00 — forked from tuongaz/BaseModelManager.php
Symfony2 Model Manager
<?php
abstract class BaseModelManager {
protected $em;
protected $class;
protected $repository;
protected $container;
/**
* Constructor.
@jeremymarc
jeremymarc / UseIndexWalker.php
Created May 15, 2012 22:32 — forked from arnaud-lb/UseIndexWalker.php
USE INDEX / FORCE INDEX in a Doctrine2 DQL query
<?php
use Doctrine\ORM\Query\SqlWalker;
/**
* Quick hack to allow adding a USE INDEX on the query
*/
class UseIndexWalker extends SqlWalker
{
const HINT_USE_INDEX = 'UseIndexWalker.UseIndex';
@jeremymarc
jeremymarc / .gitignore
Created May 26, 2012 15:46 — forked from CHH/.gitignore
PHP Templating Engine with bindable $this support in 53 LOC
vendor/
composer.lock
@jeremymarc
jeremymarc / GzipFilter.php
Created July 10, 2012 17:36 — forked from timewasted/GzipFilter.php
Assetic gzip filter
<?php
namespace Assetic\Filter;
use Assetic\Asset\AssetInterface;
use Assetic\Util\ProcessBuilder;
/**
* Runs assets through gzip.
*/
@jeremymarc
jeremymarc / logrotate.conf
Created July 13, 2012 20:05 — forked from arnaud-lb/logrotate.conf
backuprotate
/var/lib/redis/dump.rdb {
# rotate every day and keep 30 backups
daily
rotate 30
missingok
# rename backups dump.rdb-YYYYMMDD
# instead of dump.rdb.X: more rsync friendly
dateext
# create a new dump
postrotate
@jeremymarc
jeremymarc / config_dev.yml
Created July 24, 2012 17:52 — forked from havvg/config_dev.yml
optionally import Symfony2 configuration
imports:
- { resource: parameters_dev.yml }
- { resource: config.yml }
- { resource: config_local.yml, ignore_errors: true }
framework:
profiler:
only_exceptions: false
web_profiler:
<?php
namespace Clever\Presenter\CoreBundle\Assetic\Filter;
use Assetic\Filter\BaseCssFilter;
use Assetic\Asset\AssetInterface;
/**
* Fixes relative CSS urls.
* Support of Symfony relative bundles url