This file contains hidden or 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 *:3000> | |
ServerAdmin webmaster@localhost | |
DocumentRoot PATH | |
<Directory /> | |
Options FollowSymLinks | |
AllowOverride All | |
</Directory> | |
<Directory PATH > | |
Options Indexes FollowSymLinks MultiViews |
This file contains hidden or 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
sudo su postgres | |
psql | |
postgres=# create role askbot with createdb login encrypted password 'askbot'; | |
# --> CREATE ROLE | |
postgres=# create database askbot with owner=askbot; |
This file contains hidden or 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
// bad | |
function foo() | |
{ | |
alert('Bar'); | |
} | |
// good | |
function foo() { | |
alert('Bar'); | |
} |
This file contains hidden or 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
// bad | |
function foo (){ | |
alert('Bar'); | |
} | |
function foo(){ | |
alert('Bar'); | |
} | |
// good |
This file contains hidden or 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
// bad | |
var a=0; | |
if(i==='ok') alert('Foo'); | |
i+=2; | |
a=d*b*c; | |
if(a>b&&b<d||1===1) alert('Doh!'); | |
// good | |
var a = 0; | |
if(i === 1) alert('Foo'); |
This file contains hidden or 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
// bad | |
while( count < collection.length ) { | |
foo(); | |
} | |
// good | |
while(count < collection.length) { | |
foo(); | |
} |
This file contains hidden or 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
// bad | |
for (var i = 0; i < 10; i++) { | |
... | |
} | |
if (a == b) { | |
... | |
} | |
while (a !== 1) { |
This file contains hidden or 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
// bad | |
var obj = {'prop':'value', 'prop':'value', 'prop':'value'}; | |
var obj = {'prop':'value', | |
'prop':'value', | |
'prop':'value'}; | |
var obj = { | |
'prop':'value', | |
'prop':'value', | |
'prop':'value' | |
}; |
This file contains hidden or 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 documentReady(readyFunction) { | |
// I added a check here to see if addEventListener | |
// is known, cause IE will fail and we can stop safely then | |
if(document.addEventListener) { | |
document.addEventListener('DOMContentLoaded', function() { | |
document.removeEventListener('DOMContentLoaded', arguments.callee, false); | |
readyFunction(); | |
}, false); | |
} |
This file contains hidden or 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
public function add_lead(Model_Lead $lead) { | |
try { | |
$lead->save(); | |
} catch(Orm\ValidationFailed $e) { | |
$error = ['model' => $lead, 'error' => $e->get_fieldset()->validation()]; | |
Log::error($e); | |
// $error['errpor'] is NULL here, and I cannot find a way | |
// to get the actual error messages | |
return $error; | |
} |