This file contains hidden or 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
| <?php | |
| /** | |
| * Download a large distant file to a local destination. | |
| * | |
| * This method is very memory efficient :-) | |
| * The file can be huge, PHP doesn't load it in memory. | |
| * | |
| * /!\ Warning, the return value is always true, you must use === to test the response type too. | |
| * | |
| * @author dalexandre |
This file contains hidden or 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
| function slugify(text) | |
| { | |
| return text.toString().toLowerCase() | |
| .replace(/\s+/g, '-') // Replace spaces with - | |
| .replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
| .replace(/\-\-+/g, '-') // Replace multiple - with single - | |
| .replace(/^-+/, '') // Trim - from start of text | |
| .replace(/-+$/, ''); // Trim - from end of text | |
| } |
This file contains hidden or 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
| # byte-size tuts | |
| by alexander white © | |
| ## golang tutorials | |
| - [0 - installation on a Mac](https://gist.github.com/honkskillet/bd1f72223dd8e06b5ce6#golang-0---installation-on-a-mac) | |
| - [1 - packages](https://gist.github.com/honkskillet/bd1f72223dd8e06b5ce6#golang-1---packages) | |
| - [2 - remote packages](https://gist.github.com/honkskillet/bd1f72223dd8e06b5ce6#golang-2---remote-packages) | |
| - [3 - variable syntax](https://gist.github.com/honkskillet/bd1f72223dd8e06b5ce6#golang-3---variable-syntax) | |
| - [4 - functions syntax](https://gist.github.com/honkskillet/bd1f72223dd8e06b5ce6#golang-4---functions-syntax) | |
| - [5 - loops syntax](https://gist.github.com/honkskillet/bd1f72223dd8e06b5ce6#golang-5---loops-syntax) |
This file contains hidden or 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
| UPDATE table SET field = replace(field, text_needs_to_be_replaced, text_required); | |
| https://smagic39.com |