Skip to content

Instantly share code, notes, and snippets.

@lelotnk
lelotnk / main.js
Created April 19, 2015 03:58
Definindo um módulo com RequireJs e Module Patten
require(['jquery', 'app/mymodule'], function($, MyModule){
MyModule.initialize();
});
@lelotnk
lelotnk / 40-tools-for-writing-better-php.md
Last active October 9, 2024 00:32
40+ tools for writing better PHP

PHP is a server-side scripting language designed for web development, but also used as a general-purpose programming language. With over 240 million indexed domains using PHP, including major websites like Facebook, Digg and WordPress, there are good reasons why many web developers prefer it to other server-side scripting languages, such as Python and Ruby.

There are scads of PHP tools available over the internet for php developers, but finding an appropriate PHP tool is quite an arduous task and demands effort and time. Today we’ve collected 45 handy PHP development tools for developers…

Plates

Plates is a simple and easy to use PHP templates system. Plates is designed for web developers who prefer to use native PHP templates over compiled templates.

@lelotnk
lelotnk / phpnatsort.php
Created August 28, 2015 18:56
PHP Natsort
<?php
$array = array(
'/dir/arquivo-01.jpg',
'/dir/arquivo-02.jpg',
'/dir/arquivo-03.jpg',
'/dir/arquivo-04.jpg',
'/dir/arquivo-05.jpg',
'/dir/arquivo-06.jpg',
'/dir/arquivo-07.jpg',
@lelotnk
lelotnk / clean_code.md
Created September 26, 2024 00:12 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules