Skip to content

Instantly share code, notes, and snippets.

View dejanmarkovic's full-sized avatar
💭
WordPress development 24/7

Dejan Markovic dejanmarkovic

💭
WordPress development 24/7
View GitHub Profile
@dejanmarkovic
dejanmarkovic / check if all radio buttons are checked on the page.js
Created July 9, 2014 15:16
check if all radio buttons are checked on the page
//checking if all radio butons are checked
$(":radio").change(function() {
//console.log('radio change ');
var names = {};
$(':radio').each(function() {
names[$(this).attr('name')] = true;
});
//console.dir(names);
@dejanmarkovic
dejanmarkovic / to display array nicely.php
Created July 4, 2014 15:11
to display array nicely
<?php
//add <pre> tags and use print_r
ECHO ('<pre>');
print_r($array);
ECHO ("</pre>");
@dejanmarkovic
dejanmarkovic / Contact form submission with validation done first.js
Created June 23, 2014 18:41
Contact form submission with validation done first
function setup_contact_form()
{
$("form#contact").validate(
{
rules: {
cfname: {
minlength: 2,
required: true
},
clname: {
@dejanmarkovic
dejanmarkovic / next button with controller action and bootstrap formating.php
Created June 17, 2014 19:47
next button with controller action and bootstrap formating
echo $this->Html->link(
'NEXT <span class="glyphicon glyphicon-chevron-right">',
array('controller'=>'surveys', 'action'=>'next'),
array('escape' => FALSE, 'class' => 'btn btn-lg btn-success')
);
@dejanmarkovic
dejanmarkovic / Run cake console
Created June 12, 2014 18:33
Run cake console
1.$ cd C:\xampp2\htdocs\cakephp\app\Console>
2.$ cake
@dejanmarkovic
dejanmarkovic / WIN7 add php to path
Created June 10, 2014 20:28
WIN7 add php to path
1. Right-click on a My Computer icon
2. Click Properties
3. Click Advanced system settings from the left nav
4. Click Advanced tab
5. Click Environment Variables button
6. In the System Variables section, select Path (case-insensitive) and click Edit button
7. Add a semi-colon (;) to the end of the string, then add the full file system path of your PHP installation (e.g. C:\Program Files\PHP)
8. Keep clicking OK etc until all dialog boxes have disappeared
9. Close your command prompt and open it again
@dejanmarkovic
dejanmarkovic / WordPress Podcasts
Created June 10, 2014 11:51
WordPress Podcasts
http://thedispatch.fm/made-with-wp/
@dejanmarkovic
dejanmarkovic / Can't import database through phpmyadmin file size too large
Created June 7, 2014 17:20
Can't import database through phpmyadmin file size too large
1. Go to my XAMPP installed directoy C:\xampp\php
2. Open the "Configuration Settings" file named php.ini using your text editor, preferably you can also you Notepad for Windows machine.
3. Somewhere nearby on line no 886, please update it to upload_max_filesize = 128M
4. Similarly on line no 735 post_max_size = 128M
5. On line no 442 max_execution_time = 300
6. On line no 452 max_input_time = 60
7. Restart your Apache from either XAMPP Control Panel or using CMD in Windows
@dejanmarkovic
dejanmarkovic / Forms with buttons instead of input submit.js
Created June 3, 2014 16:17
Forms with buttons instead of input submit
//register click on the button
$("#submit").click(function () {
//when button is clicked submit the form
$("#registration").submit();
});
@dejanmarkovic
dejanmarkovic / Angular videos
Created April 28, 2014 21:47
Angular videos
https://egghead.io/lessons