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.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
wkhtmltopdf is broken and cannot render multiple fonts because of some issues around names. See wkhtmltopdf/wkhtmltopdf#2435
- Pick an 8 or less char name for each font and variation e.g. HelvBold, HelvLite, TimeReg
- Every variation needs to be a separate font file, with all the details renamed in Font Forge using the short name determined before.
- Give the font files the same short name (e.g. HelvBold.ttf)
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
<script src="https://unpkg.com/@webcomponents/custom-elements"></script> | |
<style> | |
body { | |
margin: 0; | |
} | |
/* Style the element from the outside */ | |
/* | |
fancy-tabs { | |
margin-bottom: 32px; |
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
public function boot() | |
{ | |
$this->publishes([ | |
__DIR__.'/vendor/twbs/bootstrap' => public_path('assets/bootstrap'), | |
], 'public'); | |
} |
Below are many examples of function hoisting behavior in JavaScript. Ones marked as works
successfuly print 'hi!' without errors.
To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js
(I may be using incorrect terms below, please forgive me)
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
// ---- | |
// Sass (v3.3.4) | |
// Compass (v1.0.0.alpha.18) | |
// ---- | |
// Capitalize string | |
// -------------------------------------------------------------------------------- | |
// @param [string] $string | |
// -------------------------------------------------------------------------------- | |
// @return [string] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder