Skip to content

Instantly share code, notes, and snippets.

<?php
class CustomDeleteModel extends Eloquent
{
// Return our custom query any time we run a query from this model
protected function query()
{
return new CustomDeleteQuery($this);
}
@JesseObrien
JesseObrien / www.conf
Created February 10, 2013 00:05
This file shows what is needed to run PHP-FPM on either a unix socket, or port 9000.
# Comment this line
#listen = /var/run/php5-fpm.sock
# Add this line
listen = 127.0.0.1:9000
// Overriding sync
var Sync = Backbone.sync;
Backbone.sync = function (method, model, options) {
var success = options.success;
var error = options.error;
// Your custom code goes here, you should be able to access
// the xhr via options.xhr, or in the second argument from the ajax call.
options.success = function (resp, status, xhr) {
success.apply(this, arguments);
array(
[0] => 'id',
[1] => '012345-12abc-fg654-4939a',
[2] => 'started_at',
[3] => '05/22/2013@3:11pm',
[4] => 'ended_at',
[5] => '05/22/2013@3:11pm',
[6] => 'ended_by',
[7] => 'Machuga',
[8] => 'ended_cleanly',
@JesseObrien
JesseObrien / Hello.html
Created May 29, 2013 01:30
Revel Hello World app
{{set . "title" "Home"}}
{{template "header.html" .}}
<h1>Hello {{.myName}}</h1>
<a href="/">Back to form</a>
{{template "footer.html" .}}
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<match target="font" >
<edit mode="assign" name="autohint"> <bool>true</bool></edit>
<edit mode="assign" name="hinting"> <bool>false</bool></edit>
<edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit>
<edit mode="assign" name="hintstyle"> <const>hintslight</const></edit>
<edit mode="assign" name="antialias"> <bool>true</bool></edit>
<edit mode="assign" name="rgba"> <const>rgb</const></edit>
@JesseObrien
JesseObrien / blade.php
Created June 20, 2013 20:52
Laravel 3 Hack views to render from string instead of file.
<?php
namespace Mynamespace;
class Blade extends \Laravel\Blade
{
public static function compile($content) {
return static::compile_string($content);
}
}
@JesseObrien
JesseObrien / laravel3composer.php
Last active December 19, 2015 00:49
Loading up a directory of composer files.
<?php
/**
* LARAVEL 3: Put this in app/start.php at the bottom
*/
/**
* Register any composers in the composers directory
*/
@JesseObrien
JesseObrien / name.conf
Last active December 19, 2015 06:18
A Good Nginx Config
server{
listen 80;
# Uncomment for SSL
#listen 443;
server_name example.com www.example.com;
# Uncomment for SSL
#ssl on;
#ssl_certificate /etc/ssl/mycert.crt;
#ssl_certificate_key /etc/ssl/mycert.key;
<?php
class ValidationModel extends Eloquent {
/**
* Hold the validation rules for the model
*
* @var array
*/
protected $rules = array();