Skip to content

Instantly share code, notes, and snippets.

View clarkeash's full-sized avatar
👨‍🚀
coding something...

Ashley Clarke clarkeash

👨‍🚀
coding something...
View GitHub Profile
@fideloper
fideloper / Gettable.php
Created March 9, 2014 19:33
Trait for making protected/private attributes "gettable", leaving "setting" the attributes a matter of business logic to be implemented.
<?php
trait Gettable {
/**
* Retrieve private attributes.
* Attributes should be protected
* so they cannot be *set* arbitrarily.
* This allows us to *get* them as if they
* were public.
@msurguy
msurguy / eloquent.md
Last active February 8, 2022 03:13
Laravel 4 Eloquent Cheat Sheet.

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';

@sterlingwes
sterlingwes / tourney.html
Created December 3, 2012 23:42
Tournament Bracket Generator (Javascript + CSS, no tables)
<!DOCTYPE html>
<html>
<head>
<title>Tournament Bracket Generator</title>
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://underscorejs.org/underscore-min.js"></script>
<script>
$(document).on('ready', function() {
var knownBrackets = [2,4,8,16,32], // brackets with "perfect" proportions (full fields, no byes)
@cespare
cespare / log.go
Created October 31, 2012 06:51
Golang apache logging
type ApacheLogRecord struct {
http.ResponseWriter
ip string
time time.Time
method, uri, protocol string
status int
responseBytes int64
elapsedTime time.Duration
}
@ziadoz
ziadoz / awesome-php.md
Last active April 17, 2024 21:06
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.