- taki kod czyta się przyjemnie i szybko (nie tylko nam).
- jeżeli styl kodu definiują pewne reguły, to nawet gdy nam kodem pracuje parę osób, to można odnieść wrażenie, jakby pisała go jedna osoba.
- piszac kod, często wracamy do niego pewnym czasie - warto jest zadbać o to, żeby czas poznawania swojego skryptu, który napisaliśmy był jak najmniej bolesny.
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
// So if I have something like this: | |
// <p>foo<i>baa</i> </p> | |
// Empty text node-^-- | |
var a = getEmptyTextNodeInAboveP(); | |
a.getIndex() // 2 | |
a.getIndex( true ) // -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
// Mocked Service | |
angular.module('mock.users', []). | |
factory('UserService', function($q) { | |
var userService = {}; | |
userService.get = function() { | |
return { | |
id: 8888, | |
name: "test user" | |
} |
JSHint
/* globals MY_GLOBAL */
/* jshint ignore:start */
/* jshint ignore:end */
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
// some comment | |
function hello() { | |
if () { | |
} else { | |
console.log('my name is Artur Delura'); | |
} | |
} |
- Clone this Gist.
- For card sizes other than A5, edit the
size
value in@page
, and theheight
andwidth
properties ofbody
. - Add contents to each face. The simplest approach is to add an image called
front.png
of the same dimensions as the card. - Generate a PDF from the HTML + CSS. If using Prince, it's as simple as
prince index.html card.pdf
. - Take the PDF to a printer, and ask them to print as many copies as you need.
public class Hello
{
public static void Main()
{
- System.Console.WriteLine("Hello, World!");
+ System.Console.WriteLine("Rock all night long!");
}
}