Skip to content

Instantly share code, notes, and snippets.

View matheusdavidson's full-sized avatar

Matheus Davidson matheusdavidson

View GitHub Profile
@matheusdavidson
matheusdavidson / gist:4772409
Last active December 12, 2015 12:29
Gallery module details.php fixed for 2.2
<?php defined('BASEPATH') or exit('No direct script access allowed');
class Module_Galleries extends Module {
public $version = '1.3';
public function info()
{
return array(
'name' => array(
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
#umask 022
# Path to your oh-my-zsh installation.
export ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="robbyrussell"
# Uncomment the following line to use case-sensitive completion.
@matheusdavidson
matheusdavidson / controller.js
Last active August 29, 2015 14:10
Controller
import Ember from 'ember';
import Mixin from './../../mixins/pagination';
export
default Ember.ArrayController.extend(Mixin, {
// setup our query params
queryParams: ["page", "perPage", "filter", "order"],
// setup orders
selOrders: [{
label: 'Recente',
value: 'created_at-asc'
import Ember from 'ember';
import PagedRemoteArray from 'ember-cli-pagination/remote/paged-remote-array';
export
default Ember.Mixin.create(PagedRemoteArray, {
loaded: 0,
changeOrder: function() {
// console.debug(PagedRemoteArray);
this.refresh();
}.observes('order'),
refresh: function() {
// Filter
if (!empty($filter)) {
$query->where('id', 'LIKE', "%{$filter}%");
$query->orWhere('name', 'LIKE', "%{$filter}%");
$query->orWhere('social_reason', 'LIKE', "%{$filter}%");
$query->orWhere('state_insc', 'LIKE', "%{$filter}%");
$query->orWhere('city_insc', 'LIKE', "%{$filter}%");
$query->orWhere('cpf', 'LIKE', "%{$filter}%");
$query->orWhere('cnpj', 'LIKE', "%{$filter}%");
$query->orWhere('email', 'LIKE', "%{$filter}%");
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'floor' in 'field list' (SQL: insert into `pro_str_halls` (`name`, `cus_id`, `created_by`, `floor`, `hal_id`, `updated_at`, `created_at`) values (teste, 0, 3, 0i547e37528bdf4, 0h547f60b6de6d4, 2014-12-03 17:12:54, 2014-12-03 17:12:54))
$query = DB::table('cal_calendar_table');
$query->select(DB::raw("
SUM(object = 'pro_assistances' AND is_first = 1 AND type = 'start') as total_atendimentos,
SUM(object = 'pro_clients' AND type = 'new') as total_clientes_novos,
SUM(object = 'pro_clients' AND type = 'edit') as total_clientes_edições,
SUM(object = 'pro_receipts' AND type = 'new') as total_notas,
SUM(object = 'pro_coupons' AND type = 'new') as total_cupons,
SUM(object = 'pro_exchange' AND type = 'made') as total_trocas
"));