- PHP >= 5.3.7
- MCrypt PHP Extension
- MySQL 5 com PDO_MYSQL
- Composer (package manager)
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
<?php | |
class CropFoto extends Eloquent { | |
private $cropper; | |
private $upload; | |
private $ratio; | |
private $scale; | |
private $config; |
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
// | |
// Escolhe qual conversão utilizar dependendo do input | |
// | |
function converter(input) { | |
if (typeof input === 'number') { | |
return toRoman(input); | |
} | |
else { | |
return toIndu(input); |
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
var slugify = function(text){ | |
/** Cria um nome web-safe sem acentos e espaços a partir de um nome. */ | |
var lettersFrom = 'áàãâäéèêëíìîïóòõôöúùûüçñ', lettersTo = 'aaaaaeeeeiiiiooooouuuucn', newText = '', text = text.toLowerCase().replace(' ', '-'); | |
for (var i = 0; i < text.length; i++) { | |
if (lettersFrom.search(text.substr(i,1)) >= 0) newText += lettersTo.substr(lettersFrom.search(text.substr(i, 1)), 1); | |
else newText += text.substr(i, 1); | |
} | |
return newText; | |
}; |
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
var gulp = require('gulp'); | |
var browserify = require('gulp-browserify'); | |
var less = require('gulp-less'); | |
var concat = require('gulp-concat'); | |
var jshint = require('gulp-jshint'); | |
var outDir = null; | |
var sources = { | |
scripts: './app/scripts/**/*.js', |
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
var Events = { | |
registry: {}, | |
nameExists: function(name) { | |
return typeof this.registry[name] !== 'undefined'; | |
}, | |
on: function(name, callback) { | |
if ( ! this.nameExists(name)) { |
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
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 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 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'; |