Skip to content

Instantly share code, notes, and snippets.

View muzfr7's full-sized avatar
🎯
Knowledge is power..

Muzafar Ali muzfr7

🎯
Knowledge is power..
View GitHub Profile
@muzfr7
muzfr7 / 01-SkillType.php
Last active April 23, 2017 12:46
Symfony Prototype Rendering Macro
<?php
namespace AppBundle\Form;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
@muzfr7
muzfr7 / php.ini
Created April 24, 2017 05:48
XDebug Configuration (XAMPP)
[XDebug]
zend_extension = "c:\xampp\php\ext\php_xdebug.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "c:\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
@muzfr7
muzfr7 / 01 - messages.en.yml
Last active April 24, 2017 07:43
Symfony Override System Errors on login page!
"Invalid credentials." : Invalid credentials.
@muzfr7
muzfr7 / 01 - parameters.yml
Last active April 24, 2017 11:42
Sending HTML Email in Symfony using SwiftMailer
parameters:
# ....
# working mailer
mailer_transport: gmail
mailer_host: smtp.gmail.com
mailer_user: register@domain.com
mailer_password: passwordForEmail
@muzfr7
muzfr7 / index.html
Created May 6, 2017 07:27
Applying JQuery Plugins to dynamically generated elements
<script type="text/javascript">
jQuery(document).ready(
function() {
$(document).on("focus", ".dateInput", function() {
$(this).mask("99/99/9999");
});
}
);
</script>
@muzfr7
muzfr7 / Symfony.gitignore
Created May 13, 2017 06:44
.gitignore file to be used with Symfony2 or 3
# Cache and logs (Symfony2)
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep
# Email spool folder
/app/spool/*
# Cache, session files and logs (Symfony3)
@muzfr7
muzfr7 / main.js
Created May 20, 2017 07:43
Automatically logout user in 1 hour if he is not changing pages.
/*
* Automatically logout user in 1 hour on no activity
*/
setTimeout(function(){
window.open("http://www.yoursite.com/user/logout", "_self")
}, 1000*60*60); // logout in 1 hour
@muzfr7
muzfr7 / Vagrantfile
Last active July 31, 2017 03:48
Sample Vagrant file
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Every Vagrant development environment requires a box. You can search for
# boxes at https://vagrantcloud.com/search.
config.vm.box = "ubuntu/trusty64"
config.vm.provider "virtualbox" do |v|
@muzfr7
muzfr7 / Homestead.yaml
Last active July 31, 2017 07:39
Sample Homestead.yml file
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox
# VM Name in Virtual Box
name: Homestead
authorize: ~/.ssh/id_rsa.pub
@muzfr7
muzfr7 / 1-LoadWorkspaces.php
Last active August 17, 2017 17:34
Sample Doctrine Fixture to default load users in database!
<?php
namespace AppBundle\DataFixtures\ORM;
use Doctrine\Common\Persistence\ObjectManager;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
use AppBundle\Entity\Workspace;
/**