I hereby claim:
- I am lucasmezencio on github.
- I am lucasmezencio (https://keybase.io/lucasmezencio) on keybase.
- I have a public key ASCP5PplAC7HIgLFDK7ELdC8rhbkfIorXt0NPD03kjnjxwo
To claim this, I am signing this object:
# Bash for loop | |
for i in /etc/*; do | |
echo "${i}" | |
done | |
# Same as above (alternate syntax) | |
# also works with other loop structures | |
for i in /etc/* | |
do | |
echo "${i}" |
I hereby claim:
To claim this, I am signing this object:
It’s not enough to write the code well. The code has to be kept clean over time. We’ve all seen code rot and degrade as time passes. So we must take an active role in preventing this degradation.
The Boy Scouts of America have a simple rule that we can apply to our profession.
Leave the campground cleaner than you found it.
If we all checked-in our code a little cleaner than when we checked it out, the code simply could not rot. The cleanup doesn’t have to be something big. Change one variable name for the better, break up one function that’s a little too large, eliminate one small bit of duplication, clean up one composite if
statement.
The point to use a slug (semantic URL) besides of improve the SEO of your articles is to prevent that the user, at the creation of for example an article, it uses special characters that aren't allowed in a URL, appropiate the usage etc. What target usage means, is context dependent.
In this article, you'll learn how to slugify a string in PHP properly, including (or not) support (conversion) for cyrilic and special latin characters.
The following function exposes a simple way to convert text into a valid slug:
Verifying that +lucasmezencio is my blockchain ID. https://onename.com/lucasmezencio |
<?php | |
// src/YourApp/Bundle/YourBundle/Twig/ToArrayExtension.php | |
namespace Appcito\Bundle\CoreBundle\Twig; | |
/** | |
* A simple twig extension that adds a to_array filter | |
* It will convert an object to array so that you can iterate over it's properties | |
*/ | |
class ToArrayExtension extends \Twig_Extension |
#!/bin/bash | |
# thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer- | |
# replace folder | |
cd "`dirname $0`/../../application/config" | |
# Check if a composer.json file is present | |
if [ -f composer.json ]; then |
UPDATE tableA AS A | |
LEFT JOIN tableB AS B on (A.name_a = B.name_b) | |
SET | |
A.update_date = B.insert_date |
mongoexport --collection collection --db db --csv --out collection.csv --fields field1,field2,field3 |
;(function($, undefined) { | |
$.extend({ | |
toUTF8 : function(text) { | |
text = text.replace(/\r\n/g,"\n"); | |
var output = []; | |
for (var n = 0 ; n < text.length ; n++) { | |
var c = text.charCodeAt(n); |