Tumblelog by Soup.io
Newer posts are loading.
You are at the newest post.
Click here to check if anything new just came in.

June 20 2010

codefail

January 19 2010

codefail

How to create a plain JavaScript object in 4 lines

function param() {
    this.varname = "example";
}
var param = new param();

December 10 2009

codefail

Did you know the boolean value "Objekt ist schon vorhanden!"?

if(alias == null) {
try {
    var obj1 = new Something(name, age, culture);
} catch(e) {
   return false;
}
   return true;  
}
else return "Objekt ist schon vorhanden!";
codefail

Flexible Pattern to create an Object in the U.S.A...

// Create a new Object and set it's currency
if((currency = currencies.get("EUR")) == null) {               
currency = new Currency("Euro", "EUR", 1);
currency.persist();
}

December 09 2009

codefail

Alias != Alias == null ? this !

if(root.clubs.get(alias) == null) this.alias = alias;
if(this.alias != alias){
    alertFunct("Vereinsalias existiert bereits!");
    redirect(alias);
} else this.alias = alias;
codefail

Guess the city...

city = city.split(" - ");
if((city = country.cityCollection.get(city[0])) == null) {
    // do something
}
codefail

Deleted 6 files of codefail...

    Updated to revision 123.
   ===== File Statistics: =====
   Merged: 1
   Deleted: 6
   Added: 8
   Updated: 17
codefail

How to document nothing...

/**
/**
* All the Macros for the root are defined here
* @param {Sting} path to append to the mountpoint
* @member Root
*/

{End of File}
codefail

How to limit your VARCHARs length to 1.000 characters...

if(string == "" && string.length < 1000) return true;
codefail

How to return a really simple String with 4 lines of code...

var password = randomPasswortGenerator();
var dynamicHTML = "";
dynamicHTML += password;

return dynamicHTML;
Older posts are this way If this message doesn't go away, click anywhere on the page to continue loading posts.
Could not load more posts
Maybe Soup is currently being updated? I'll try again automatically in a few seconds...
Just a second, loading more posts...
You've reached the end.

Don't be the product, buy the product!

Schweinderl