Skip to content

Instantly share code, notes, and snippets.

Artur Delura adelura

Block or report user

Report or block adelura

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View MarkdownDiffExample.md
public class Hello
{
   public static void Main()
   {
-      System.Console.WriteLine("Hello, World!");
+      System.Console.WriteLine("Rock all night long!");
   }
}
@adelura
adelura / README.md
Created Mar 23, 2017 — forked from hubgit/README.md
A5 printed card with HTML + CSS
View README.md
  1. Clone this Gist.
  2. For card sizes other than A5, edit the size value in @page, and the height and width properties of body.
  3. Add contents to each face. The simplest approach is to add an image called front.png of the same dimensions as the card.
  4. Generate a PDF from the HTML + CSS. If using Prince, it's as simple as prince index.html card.pdf.
  5. Take the PDF to a printer, and ask them to print as many copies as you need.
View description.md

JSHint

/* globals MY_GLOBAL */

/* jshint ignore:start */
/* jshint ignore:end  */
@adelura
adelura / mock-service-example.js
Last active Sep 9, 2015 — forked from alicial/mock-service-example.js
AngularJS: Setting up a mocked service to use in controller unit tests.
View mock-service-example.js
// Mocked Service
angular.module('mock.users', []).
factory('UserService', function($q) {
var userService = {};
userService.get = function() {
return {
id: 8888,
name: "test user"
}
@adelura
adelura / opis.md
Last active Aug 29, 2015
Jakość kodu
View opis.md

Jakość i czytelność kodu.

Bardzo ważne jest, żeby kod, który piszemy był czytelny. Czemu?

  • 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.

Co składa się na czytelny kod?

View ufdu
// 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 ????
View hello.js
// some comment
function hello() {
if () {
} else {
console.log('my name is Artur Delura');
}
}
You can’t perform that action at this time.