Skip to content

Instantly share code, notes, and snippets.

View JoshuaEstes's full-sized avatar
👨‍💻

Joshua Estes JoshuaEstes

👨‍💻
View GitHub Profile
@JoshuaEstes
JoshuaEstes / 00-README.markdown
Last active August 29, 2015 14:00
My goto files for when I initialize a new symfony2 project. It includes bash scripts, composer.json files and a few other things.

README

These are the default files that I will usually start with when setting up a symfony2 project to use vagrant and puppet. I'm putting this readme file here for future updates.

Usage

Make sure the files that end in .sh are executable.

@martindale
martindale / README.md
Last active August 29, 2015 14:03
README.md Template

Getting Started

Overview

One or two paragraph introduction on the objective of this library.

Quick Start

If you are unsure of our project and just want to play around, you can get things set up quickly by:

@JoshuaEstes
JoshuaEstes / Vagrant.rst
Last active August 29, 2015 14:08
Useful Oneliners
//+------------------------------------------------------------------+
//| LiveAlligator.mq4 |
//| Copyright © 2011, MetaQuotes Software Corp. |
//| http://www.mql4.com/ru/users/rustein |
//-------------------------------------------------------------------+
// Trend Detection function
#define BULL 1
#define BEAR 2
// Input variables
@lanwin
lanwin / add_users_to_projects.sh
Created February 2, 2012 08:41
Script to Automatically add all GitLab users to all projects
#!/bin/sh
baseurl=http://mygitlaburl
usermail=adminuser@mymailserver
userpass=adminpassword
repo_access=2 #0=denied 1=read 2=read&write
project_access=2 #0=deined 1=read 2=report 3=admin
# login
curl -s -I -c cookies.txt -d "utf8=✓&user[email]=$usermail&user[password]=$userpass&commit=Sign+in" $baseurl/users/sign_in
@kriswallsmith
kriswallsmith / QSAListener.php
Created August 8, 2012 18:23
implements QSA on Symfony2 redirects
<?php
use JMS\DiExtraBundle\Annotation as DI;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
/** @DI\Service */
class QSAListener
{
private $blacklist;
@jmather
jmather / LoginTest.php
Created October 4, 2012 19:55
Authenticate a user login
<?php
namespace Application\Sonata\UserBundle\Tests\Functional;
use IC\Bundle\Base\TestBundle\Test\WebTestCase;
class LoginTest extends WebTestCase
{
/**
* {@inheritdoc}
@beberlei
beberlei / CommandMethodMapper.php
Created November 24, 2012 23:51
Symfony Form DataMapper that uses a command method to write data back on object
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@nfedyashev
nfedyashev / master.sh
Created June 13, 2013 00:47
Continuous deployment script
# Disable NewRelic pinging
curl https://heroku.newrelic.com/accounts/xxxxx/applications/yyyyyyyy/ping_targets/disable -X POST -H "X-Api-Key: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
heroku maintenance:on --app yourapp-staging
heroku pg:reset DATABASE --confirm yourapp-staging --app yourapp-staging
heroku pgbackups:restore DATABASE `heroku pgbackups:url --app yourapp-production` --app yourapp-staging --confirm yourapp-staging
git remote add heroku_yourapp-staging git@heroku.com:yourapp-staging.git
git push heroku_yourapp-staging $COMMIT_ID:master -f
heroku_run 'rake db:migrate' yourapp-staging
heroku restart --app yourapp-staging
heroku maintenance:off --app yourapp-staging
@jubianchi
jubianchi / sf2_standalone_form.php
Created August 25, 2011 07:31
How to use Symfony2 Form Component Standalone
<?php
namespace Standalone\Form;
use \Symfony\Component\HttpFoundation as SHttp;
use \Symfony\Component\Form as SForm;
use \Symfony\Component\DependencyInjection as SDI;
use \Symfony\Bridge as SBridge;
//Register all your autoload function here
//...