This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('input#submit').click(function(){ | |
var email = $('input#email').val(); | |
var flag = true; | |
$('input.req').each(function(){ | |
// if the input.req is empty... | |
if ($(this).val() == "") { | |
$(this).nextAll('span:first').fadeIn(); | |
flag = false; | |
} else { | |
// if the input#email field has no @ sign... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function glowNext(jq){ | |
jq.eq(0).animate({"color": "#FFC000"}, 75, function(){ | |
(jq=jq.slice(1)).length && glowNext(jq); | |
}); | |
}; | |
glowNext($('span.tag')); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Copy directory to remote server from remote server | |
scp -r sourcedir/ [email protected]:/dest/dir/ | |
Run a scheduled rake task(lets say update sphinx indexing on every 30 min periodically) on Lunux crontab: | |
# find where is your rake(which rake) | |
#m h dom mon dow user command | |
*/30 * * * * root /bin/bash -l -c 'searchd --stop -c /var/rails/project/current/config/production.sphinx.conf && cd /var/rails/project/current && RAILS_ENV=production /usr/local/bin/rake ts:rebuild && chmod -R 777 tmp/' | |
Create Symbolic link(Short cut) | |
ln -s /source/dir destination/dire/short_cut_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var eventClick = (navigator.userAgent.match(/(iPad|iPhone|Android)/i)) ? "touchstart" : "click"; | |
$('.myselector').bind(eventClick, function(event) { | |
// do stuff | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<VirtualHost *:80> | |
ServerAdmin webmaster@localhost | |
DocumentRoot /home/alex/Web | |
<Directory /> | |
Options Indexes FollowSymLinks Includes ExecCGI | |
AllowOverride All | |
Require all granted | |
Allow from all | |
</Directory> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// WP_Query arguments | |
$args = array ( | |
'post_type' => 'page', | |
'posts_per_page' => '4', | |
'post_parent' => 9 | |
); | |
// The Query | |
$query = new WP_Query( $args ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('div').each(function(index, el) { | |
// Fetch an array of all the data | |
el = $(el); | |
var data = el.data(), | |
i; | |
// Fetch all the key-names and put them in a variable called keys | |
var keys = $.map(data , function(value, key) { return key; }); | |
// Loop through the keys, remove the attribute if the key contains "lorem". | |
for(i = 0; i < keys.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ----------------------------------------------------------------- | |
# .gitignore for WordPress | |
# ----------------------------------------------------------------- | |
# ignore everything in the root except the "wp-content" directory. | |
/* | |
!wp-content/ | |
# ignore all files starting with . | |
.* |
OlderNewer