- mod_rewrite do Apache
- PHP >= 5.3.7
- MCrypt PHP Extension
- MySQL 5 com PDO_MYSQL
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 | |
| // Extracted from the Laravel Framework (http://laravel.com) | |
| function toSlug($title, $separator = '-', $to_lower = true) { | |
| // Convert all dashes/underscores into separator | |
| $flip = $separator == '-' ? '_' : '-'; | |
| $title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title); |
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
| #!/bin/bash | |
| while [ 1 ] | |
| do | |
| if [ $(networksetup -getinfo Wi-Fi | grep -c 'IP address:') = '1' ] | |
| then $(networksetup -setairportnetwork en1 DigitalBox q2w3e4r5) | |
| fi | |
| sleep 3 | |
| done |
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
| # You can run the following commands from any directory. | |
| curl -sS https://getcomposer.org/installer | php | |
| sudo mv composer.phar /usr/local/bin/composerecho 'alias composer="/usr/local/bin/composer.phar"' >> ~/.bash_profile | |
| composer global require "laravel/envoy=~1.0" | |
| echo 'alias envoy=".composer/vendor/laravel/envoy/envoy"' >> ~/.bash_profile |
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 | |
| // Altere as configurações | |
| $config = array( | |
| 'version' => '5.3.7', | |
| 'max_size' => '10M', | |
| 'dir' => 'exemplo_escrita', | |
| 'database' => array( | |
| 'host' => 'localhost', |
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
| var source = require('vinyl-source-stream'); | |
| var gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var browserify = require('browserify'); | |
| var reactify = require('reactify'); | |
| var watchify = require('watchify'); | |
| var notify = require("gulp-notify"); | |
| var scriptsDir = './scripts'; | |
| var buildDir = './build'; |
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
| var isPropEqual = function(propName) { | |
| return function(subject) { | |
| return function(obj) { | |
| return obj[propName] === subject; | |
| }; | |
| } | |
| }; | |
| var isStatus = isPropEqual('status'); |
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
| var nextArrayItem = function(arr) { | |
| var len = arr.length; | |
| return function(current) { | |
| var currentIndex = arr.indexOf(current); | |
| return currentIndex + 1 === len | |
| ? arr[0] : arr[currentIndex + 1] | |
| }; | |
| } | |
| var nextStatus = nextArrayItem(['fred', 'angela', 'mark']); |
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
| var Events = { | |
| registry: {}, | |
| nameExists: function(name) { | |
| return typeof this.registry[name] !== 'undefined'; | |
| }, | |
| on: function(name, callback) { | |
| if ( ! this.nameExists(name)) { |