Skip to content

Instantly share code, notes, and snippets.

View odirleiborgert's full-sized avatar
💻
Working

Odirlei Borgert odirleiborgert

💻
Working
View GitHub Profile
/**
* Description of StringUtil
*
* @author <rafaelgou@gmail.com> Rafael Goulart
*/
class StringUtil {
/**
* Slugify a text and remove accents
*
<?php
namespace Acme\CoreBundle\Twig;
class DateSinceExtension extends \Twig_Extension
{
public function getFilters()
{
return array(
'date_since' => new \Twig_Filter_Method($this, 'dateSince'),
var gulp = require('gulp');
var browserSync = require('browser-sync');
var reload = browserSync.reload;
var prefixer = require('gulp-autoprefixer');
var changed = require('gulp-changed');
var imagemin = require('gulp-imagemin');
var jshint = require('gulp-jshint');
var stylish = require('jshint-stylish');
var minifycss = require('gulp-minify-css');
var minifyhtml = require('gulp-minify-html');
@odirleiborgert
odirleiborgert / 02_gulp.js
Created September 28, 2015 12:34
02_gulp.js
'use strict';
var watchify = require('watchify');
var browserify = require('browserify');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var buffer = require('vinyl-buffer');
var gutil = require('gulp-util');
var sourcemaps = require('gulp-sourcemaps');
@odirleiborgert
odirleiborgert / .env.travis
Created June 10, 2016 01:06 — forked from gilbitron/.env.travis
Laravel 5 Travis CI config
APP_ENV=testing
APP_KEY=SomeRandomString
DB_CONNECTION=testing
DB_TEST_USERNAME=root
DB_TEST_PASSWORD=
CACHE_DRIVER=array
SESSION_DRIVER=array
QUEUE_DRIVER=sync
@odirleiborgert
odirleiborgert / deploy.php
Created June 23, 2016 13:57 — forked from brunofonseca/deploy.php
Arquivo de Configuração deploy
<?php
require 'recipe/symfony.php';
server('NOME_SERVIDOR', 'IP_SERVIDOR', PORTA_SSH)
->user('USUARIO')
->forwardAgent()
->stage('PRODUCTION_DEVELOPMENT_TESTE')
->env('deploy_path', 'caminho');
@odirleiborgert
odirleiborgert / reset.less
Created July 27, 2016 19:03 — forked from joshuapowell/reset.less
LESS: Global LESS CSS reset that gives elements default formatting.
/**
* Global Reset of all HTML Elements
*
* Resetting all of our HTML Elements ensures a smoother
* visual transition between browsers. If you don't believe me,
* try temporarily commenting out this block of code, then go
* and look at Mozilla versus Safari, both good browsers with
* a good implementation of CSS. The thing is, all browser CSS
* defaults are different and at the end of the day if visual
* consistency is what we're shooting for, then we need to

Moving from jQuery

Events

// jQuery
$(document).ready(function() {
  // code
})
@odirleiborgert
odirleiborgert / gulpfile.js
Created November 3, 2016 12:18 — forked from HPieters/gulpfile.js
BrowserSync Gulpfile
//load plugins
var gulp = require('gulp'),
compass = require('gulp-compass'),
autoprefixer = require('gulp-autoprefixer'),
minifycss = require('gulp-minify-css'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
concat = require('gulp-concat'),
notify = require('gulp-notify'),
livereload = require('gulp-livereload'),

Folder Structure

Motivations

  • Clear feature ownership
  • Module usage predictibility (refactoring, maintainence, you know what's shared, what's not, prevents accidental regressions, avoids huge directories of not-actually-reusable modules, etc)