Skip to content

Instantly share code, notes, and snippets.

@DanielG
Created December 29, 2010 20:04
Show Gist options
  • Select an option

  • Save DanielG/758995 to your computer and use it in GitHub Desktop.

Select an option

Save DanielG/758995 to your computer and use it in GitHub Desktop.

Revisions

  1. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -41,7 +41,7 @@
    - exception: single line/empty function definition: `function(){}`

    - parameters have spaces after comma
    bla(b1, b2, b3);
    bla(b1, b2, b3);

    - when comma'd stuff needs to be broken up into multiple lines they are in front

  2. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 10 additions and 9 deletions.
    19 changes: 10 additions & 9 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -44,12 +44,13 @@
    bla(b1, b2, b3);

    - when comma'd stuff needs to be broken up into multiple lines they are in front
    {
    bla: 'bla'
    , bla2: 'bla'
    }

    or

    bla(blaaaaaaaaaaaaaaaaaaaaaaaaaaa
    , blaaaaaaaaaaaaaaaaa2)

    {
    bla: 'bla'
    , bla2: 'bla'
    }
    or
    bla(blaaaaaaaaaaaaaaaaaaaaaaaaaaa
    , blaaaaaaaaaaaaaaaaa2)
  3. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 29 additions and 29 deletions.
    58 changes: 29 additions & 29 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -3,53 +3,53 @@
    - if's always have space before braces
    - if's always have braces

    if() {
    return;
    }
    if() {
    return;
    }

    - exception: `if(err) throw err;`

    - else aligns with if's closing brace

    if() {
    } else {
    }
    if() {

    } else {

    }

    - multi command ifs must be multi line

    if(bla) {
    bla;
    doubleBla;
    }
    if(bla) {
    bla;
    doubleBla;
    }

    - exception: `if(err) { callback(err); return; }`

    - function definitions never have spaces before brackets
    - function definitions have a space before the opening brace
    function() {
    function() {
    return;
    }

    or

    function bla() {
    return;
    }

    or

    function bla() {
    return;
    }
    }

    - exception: single line/empty function definition: `function(){}`

    - parameters have spaces after comma
    bla(b1, b2, b3);

    - when comma'd stuff needs to be broken up into multiple lines they are in front
    {
    bla: 'bla'
    , bla2: 'bla'
    }
    or
    bla(blaaaaaaaaaaaaaaaaaaaaaaaaaaa
    , blaaaaaaaaaaaaaaaaa2)
    {
    bla: 'bla'
    , bla2: 'bla'
    }

    or

    bla(blaaaaaaaaaaaaaaaaaaaaaaaaaaa
    , blaaaaaaaaaaaaaaaaa2)
  4. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -3,15 +3,15 @@
    - if's always have space before braces
    - if's always have braces

    if () {
    if() {
    return;
    }

    - exception: `if(err) throw err;`

    - else aligns with if's closing brace

    if () {
    if() {
    } else {
  5. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 19 additions and 0 deletions.
    19 changes: 19 additions & 0 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -9,6 +9,14 @@

    - exception: `if(err) throw err;`

    - else aligns with if's closing brace

    if () {
    } else {
    }

    - multi command ifs must be multi line

    if(bla) {
    @@ -34,3 +42,14 @@

    - parameters have spaces after comma
    bla(b1, b2, b3);

    - when comma'd stuff needs to be broken up into multiple lines they are in front
    {
    bla: 'bla'
    , bla2: 'bla'
    }

    or

    bla(blaaaaaaaaaaaaaaaaaaaaaaaaaaa
    , blaaaaaaaaaaaaaaaaa2)
  6. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 14 additions and 14 deletions.
    28 changes: 14 additions & 14 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -11,26 +11,26 @@

    - multi command ifs must be multi line

    if(bla) {
    bla;
    doubleBla;
    }
    if(bla) {
    bla;
    doubleBla;
    }

    - exception: `if(err) { callback(err); return; }`

    - function definitions never have spaces before brackets
    - function definitions have a space before the opening brace
    function() {
    return;
    }

    or

    function bla() {
    return;
    }
    function() {
    return;
    }
    or
    function bla() {
    return;
    }

    - exception: single line/empty function definition: `function(){}`

    - parameters have spaces after comma
    bla(b1, b2, b3);
    bla(b1, b2, b3);
  7. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -3,9 +3,9 @@
    - if's always have space before braces
    - if's always have braces

    if () {
    return;
    }
    if () {
    return;
    }

    - exception: `if(err) throw err;`

  8. Daniel Gröber revised this gist Dec 29, 2010. 1 changed file with 9 additions and 3 deletions.
    12 changes: 9 additions & 3 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -2,20 +2,24 @@
    - 80 character max per line
    - if's always have space before braces
    - if's always have braces
    - exception: `if(err) throw err;`

    if () {
    return;
    }

    - exception: `if(err) throw err;`

    - multi command ifs must be multi line
    - exception: `if(err) { callback(err); return; }`

    if(bla) {
    bla;
    doubleBla;
    }

    - exception: `if(err) { callback(err); return; }`

    - function definitions never have spaces before brackets
    - function definitions have a space before the opening brace
    - exception: single line/empty function definition: `function(){}`
    function() {
    return;
    }
    @@ -26,5 +30,7 @@
    return;
    }

    - exception: single line/empty function definition: `function(){}`

    - parameters have spaces after comma
    bla(b1, b2, b3);
  9. Daniel Gröber created this gist Dec 29, 2010.
    30 changes: 30 additions & 0 deletions guidelines.mdown
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,30 @@
    - 4 space indentation
    - 80 character max per line
    - if's always have space before braces
    - if's always have braces
    - exception: `if(err) throw err;`
    if () {
    return;
    }
    - multi command ifs must be multi line
    - exception: `if(err) { callback(err); return; }`
    if(bla) {
    bla;
    doubleBla;
    }

    - function definitions never have spaces before brackets
    - function definitions have a space before the opening brace
    - exception: single line/empty function definition: `function(){}`
    function() {
    return;
    }

    or

    function bla() {
    return;
    }

    - parameters have spaces after comma
    bla(b1, b2, b3);