Skip to content

Instantly share code, notes, and snippets.

@willmendesneto
willmendesneto / Annotations.php
Last active July 18, 2016 12:17
Validation in Codeigniter + Grocery CRUD
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
class Annotations extends MY_Controller {
/**
* Class Constructor
*
* @return void
*/
public function __construct()
@willmendesneto
willmendesneto / README.md
Last active December 21, 2015 04:48
List of Projects Links
@willmendesneto
willmendesneto / htmlMinification.php
Created October 30, 2013 17:09
Simple HTML Output minifcation example
<?php
/**
* Minify HTML output (HTML)
*
* How to use:
*
* Call function using ob_start();
*
* if(extension_loaded('zlib') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== FALSE){
@willmendesneto
willmendesneto / Gruntfile.js
Created January 9, 2014 00:22
Gruntfile template for use in projects
// Generated on 2013-10-07 using generator-angular 0.4.0
//
// OBS:
// Replace the string with informations
// '<%= yeomanConfig.assets.css %>' = Stylesheets folder
// '<%= yeomanConfig.assets.js %>' = Scripts folder
// '<%= yeomanConfig.assets.img %>' = Images folder
// '<%= yeomanConfig.assets.font %>' = Fonts folder
//
'use strict';
@willmendesneto
willmendesneto / Interface.js
Created March 31, 2014 18:02
Interface example in Javascript
// INTERFACE "X"
var X = {
share: function(clientEmail, email ){}
};
// LIB "A"
var A = {
type: 'facebook'
};
// LIB "B"
var B = {
@willmendesneto
willmendesneto / print-by-divisors.js
Last active August 29, 2015 14:01
PrintByDivisors: my resolution for FizzBuzz problem
var PrintByDivisors = {
opts: {
begin: 1,
end: 100,
numbers: [15, 3, 5],
outputs: ['SouDev', 'Sou', 'Dev']
},
extend: function(target, source) {
target = target || {};
@willmendesneto
willmendesneto / Gruntfile.js
Last active August 29, 2015 14:01
Files requireds for create a project for create angular modules using Grunt task manager
'use strict';
// # Globbing
// for performance reasons we're only matching one level down:
// 'test/spec/{,*/}*.js'
// use this if you want to recursively match all subfolders:
// 'test/spec/**/*.js'
// OBS:
// Replace the string with informations
@willmendesneto
willmendesneto / jogos.js
Last active August 29, 2015 14:02
World Cup in six lines of Javascript based in @fmasanori jogos.py. Zepto/Jquery dependency
// Example in http://codepen.io/willmendesneto/pen/Iguor
$.get('http://worldcup.sfg.io/matches', function(data){
data.forEach(function(item){
if (item.status === 'completed') {
console.log(item.home_team.country + ' ' + item.home_team.goals + ' x ' + item.away_team.country + ' ' + item.away_team.goals);
}
});
}, 'json');
@willmendesneto
willmendesneto / Vagrantfile
Last active August 29, 2015 14:04
Vagrantfile based in Vaprobash project
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Config Github Settings
github_username = "fideloper"
github_repo = "Vaprobash"
github_branch = "1.0.1"
github_url = "https://raw.githubusercontent.com/#{github_username}/#{github_repo}/#{github_branch}"
# Server Configuration
@willmendesneto
willmendesneto / gist:622aa25cf9bc6fcb81cf
Last active August 29, 2015 14:12
CLI: Funções e Alias

Algumas informações para inserirmos algumas funções e aliases no ambiente CLI. Como utilizo o oh-my-zsh, carrego alguns plugins por padrão:

plugins=(git rails ruby frontend-search nvm rvm vagrant)

É sempre uma boa prática modularizar os arquivos. Para isto criaremos 2 arquivos:

  • .functions: arquivo onde ficarão as funções;
  • .aliases: arquivo onde ficarão os atalhos/aliases;