Skip to content

Instantly share code, notes, and snippets.

View felipepodesta's full-sized avatar
👨‍💻
Stairway To Heaven

Felipe Podestá felipepodesta

👨‍💻
Stairway To Heaven
View GitHub Profile
<?php
/**
* Compiles language strings
* Standalone:
* {{"some.string_here"}} = <?php echo \Lang::line("some.string_here")->get(); ?>
* Not Standalone (ie, within a function,etc)
* {"some.string_Here"} = \Lang::line('some.string_here')->get()
* @param string Template
* @return string Template
**/
<div class="clock">
<div class="hours"></div><!--
--><div class="minutes"></div><!--
--><div class="seconds"></div><!--
--><div class="twelvehr"></div>
</div>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

Conventions:

Defining Eloquent model (will assume that DB table named is set as plural of class name and primary key named "id"):

class Shop extends Eloquent {}

Using custom table name

protected $table = 'my_shops';

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

Other people's projects:

My projects (tutorials are on my blog at http://maxoffsky.com):

#!/bin/bash
# @author: Seb Dangerfield
# http://www.sebdangerfield.me.uk/?p=513
# Created: 11/08/2011
# Modified: 07/01/2012
# Modified: 17/05/2012
# Modify the following to match your system
NGINX_CONFIG='/etc/nginx/sites-available'
NGINX_SITES_ENABLED='/etc/nginx/sites-enabled'
require 'ruble'
command 'Generate Entity Getter/Setters' do |cmd|
cmd.key_binding = 'M1+M2+G'
cmd.scope = 'source.php'
cmd.output = :replace_document
cmd.input = :document
cmd.invoke do |context|
file = context.TM_SELECTED_FILES.match(/([a-zA-Z0-9]+)\.php/)[1]
line = STDIN.read
columns = line.scan(/@Column\(name="([^"]+)", type="([^"]+)"/)
<?php
namespace Davzie\ProductCatalog\Entities;
use Validator;
use Input;
use Illuminate\Support\MessageBag;
use Exception;
use App;
class Base {
// Node.js CheatSheet.
// Download the Node.js source code or a pre-built installer for your platform, and start developing today.
// Download: http://nodejs.org/download/
// More: http://nodejs.org/api/all.html
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
<?php
/*
* The issue at hand is how to show checked boxes in
* a Laravel edit form using Eloquent models.
*/
/*
* My Models
*