Skip to content

Instantly share code, notes, and snippets.

<?php
/*
No Controller use
Sysfeedback::success("mensagem");
Na View/Layout use
Sysfeedback::render();
Isto irá mostrar todas as mensagens disponíveis
*/
@beeblebrox3
beeblebrox3 / gist:5930910
Created July 5, 2013 00:12
xbox music connector for Chrome-Last.fm-Scrobbler
(function xboxConnector() {
// listen to changes in player
// wait for the duration appears
// validate
// if valid, scrobble
var working = false;
$(function() {
var $nowPlaying = $('.playerNowPlaying'),
$nowPlayingDuration = $('.playerDurationText');
<?php
// file: app/plugins/pesquisa/models/pesquisagrupoquestao.php
class Pesquisagrupoquestao extends AppModel {
var $name = 'Pesquisagrupoquestao';
var $useTable = 'pesquisagruposquestoes';
var $hasMany = array(
'Pesquisaquestao' => array(
'className' => 'Pesquisaquestao',
'foreignKey' => 'pesquisagrupoquestao_id',
<?php namespace Illuminate\Html;
use Illuminate\Routing\UrlGenerator;
use Illuminate\Session\Store as Session;
class FormBuilder {
/**
* The HTML builder instance.
*
<?php
namespace Sigep\EloquentEnhancements\Traits;
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
use Illuminate\Database\Eloquent\Relations\HasMany;
use Illuminate\Database\Eloquent\Relations\MorphMany;
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
use Illuminate\Mail\Message;
use Illuminate\Support\MessageBag;
<?php
namespace App\Models\Observers;
use Illuminate\Validation\Factory;
abstract class AbstractObserver
{
/**
* The Validator instance
<?php
protected function updateUniques(array $rules, Eloquent $model)
{
foreach ($rules as $field => $rule) {
$rules[$field] = preg_replace(
"/unique\:([a-z_]+)/i", 'unique:$1,' . $field . ',' . $model->id, $rule
);
}
── js
├── app.js
├── bootstrap.js
├── components
│ └── componentX
│ ├── form.js
│ └── index.js
├── config.js
├── eventManager.js
├── helpers
/**
* Get element from obj by string path
* @param {string} path
* @param {Object} obj reference object. If not provided or invalid, window will be used
* @return {mixed}
*/
App.helpers.object.getFlattened = function (path, obj) {
"use strict";
if (typeof path !== "string") {
<?php
class Xpto
{
private $data = array (
'a' => 'b',
);
public $b = '1';