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 filter_users_dropdown() { | |
search = $('#from').val().toLowerCase(); | |
$('#users-dropdown li').each(function(index) { | |
var value = $(this).text().toLowerCase(); | |
n = value.search( search ); |
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
$('.myElements').each(function() { | |
var elem = $(this); | |
// Save current value of element | |
elem.data('oldVal', elem.val()); | |
// Look for changes in the value | |
elem.bind("propertychange keyup input paste", function(event){ | |
// If value has changed... | |
if (elem.data('oldVal') != elem.val()) { |
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
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTP_HOST} !^$ | |
# BEGIN force www before URL | |
RewriteCond %{HTTP_HOST} !^www\. [NC] | |
RewriteCond %{HTTPS}s ^on(s)| | |
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] | |
# END for www on URL | |
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
window.requestAnimFrame = (function(callback) { | |
return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || | |
function(callback) { | |
window.setTimeout(callback, 1000 / 60); | |
}; | |
})(); | |
function animate() { | |
var canvas = document.getElementById('canvas_1'); | |
var context = canvas.getContext('2d'); |
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
# Global composer install for MAMP Users on OSX | |
# http://getcomposer.org/doc/00-intro.md#globally | |
# For PHP 5.4 Use: | |
# alias php=/Applications/MAMP/bin/php/php5.4.4/bin/php; | |
alias php=/Applications/MAMP/bin/php/php5.3.6/bin/php; | |
curl -sS https://getcomposer.org/installer | php; | |
mv composer.phar /usr/local/bin/composer; | |
composer help; |
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
#this is a way to change the default php to MAMP php version you want | |
#if you do `which php` you eill see: /usr/bin/php that is the php that comes with OSX installation | |
which php | |
#do this to export the path to you .profile ou .bash_profile | |
export PATH=/Applications/MAMP/bin/php/php5.4.4/bin:$PATH | |
#then run this command to update the path | |
source ~/.bash_profile |
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
// JavaScript Class Definition and Inheritance | |
function BaseClass() { | |
//BaseClass constructor code goes here | |
} | |
BaseClass.prototype.getName = function() { | |
return "BaseClass"; | |
} | |
function SubClass() { |
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 | |
function autoload($className) | |
{ | |
$className = ltrim($className, '\\'); | |
$fileName = ''; | |
$namespace = ''; | |
if ($lastNsPos = strrpos($className, '\\')) { | |
$namespace = substr($className, 0, $lastNsPos); | |
$className = substr($className, $lastNsPos + 1); |
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
#make ZF2 work on shared hosting using this htaccess | |
#SetEnv ZF2_PATH /home/username/zf2lib | |
RewriteEngine On | |
RewriteRule ^\.htaccess$ - [F] | |
RewriteCond %{REQUEST_URI} ="" | |
RewriteRule ^.*$ /public/index.php [NC,L] | |
RewriteCond %{REQUEST_URI} !^/public/.*$ | |
RewriteRule ^(.*)$ /public/$1 | |
RewriteCond %{REQUEST_FILENAME} -f | |
RewriteRule ^.*$ - [NC,L] |
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
First you have to download the 32bit or 64bit Linux binaries from here and unzip the contents to /usr/local. | |
# cd /tmp | |
# curl -O http://downloads.mongodb.org/linux/mongodb-linux-i686-2.4.9.tgz | |
# sudo tar -zxf /tmp/mongodb-linux-i686-2.4.9.tgz -C /usr/local | |
Then you need to configure some symbolic links. |
OlderNewer