How can I perform a syntax check on an .htaccess file in a shared hosting environment? – Problems with loading […]
Tag: #syntax
Reset Vim syntax highlighting
Ever got irritated when Vim fails to properly highlight syntax in complex file opened in the middle? For example, when […]
When to use alternative syntax
Please, please use alternative syntax when mixing HTML & PHP. This is ugly: <?php if( some_function() ) { ?> Lorem […]
PHP: Short syntax for arrays
Just letting you guys know that now you can do this: $newSyntax = [ ‘key’ => ‘value’, ‘anotherKey’ => ‘anotherValue’ […]
Reset Vim syntax highlighting
Ever got irritated when Vim fails to properly highlight syntax in complex file opened in the middle? For example, when […]
git diff highlighting
using vim this works out of the box 😉 git config color.diff auto source: http://www.acloudtree.com/nerd-git-diff-syntax-highlighting-using-vim/
Python tuple unpacking tricks a.la Erlang
_, (_, x) = a, (b, (c, d)) = (1, (2, (3, (4, 5, 6)))) …allows one to unpack the […]
Simple Java HTML syntax highlighter for XML code
This simple code snippet will generate better looking html for <pre> elements with XML snippets in them. It may be […]
jQuery’s “Dollar Sign” Syntactic Quirk – An Inherent Vulnerability?
jQuery has this quirk, whereby one can’t pass user data to the $() function: $(‘<img src=1 onerror=alert(document.domain)>’) The $() code […]
Removing a machine from domain using PowerShell
A server stack is the collection of software that forms the operational infrastructure on a given machine. In a computing […]
Don’t manage the semi collin
when i am working on php classes some times I need to run multiple class::functions on an object. $query = […]
JavaScript thought: for…else and while…else statements
A feature that would be handy in JavaScript: <br> for…else statements: // Loop through an array of people: for (var […]
Prefer %w to [] when you need an array of strings
# bad STATES = [‘draft’, ‘open’, ‘closed’] # good STATES = %w(draft open closed)
JS syntax made easy: literal object vs. class syntax
There are so many ways to define a method inside a class or a literal object. They are similar enough […]
Use dictionary lookups instead of switch statements
Switch statements are fun and all, but they can be awkward to write and read: function getTemplateForState(state) { switch (state) […]