Skip to content

Instantly share code, notes, and snippets.

Avatar
👨‍🚀
coding something...

Ashley Clarke clarkeash

👨‍🚀
coding something...
View GitHub Profile
@fideloper
fideloper / Gettable.php
Created Mar 9, 2014
Trait for making protected/private attributes "gettable", leaving "setting" the attributes a matter of business logic to be implemented.
View Gettable.php
<?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.
@cespare
cespare / log.go
Created Oct 31, 2012
Golang apache logging
View log.go
type ApacheLogRecord struct {
http.ResponseWriter
ip string
time time.Time
method, uri, protocol string
status int
responseBytes int64
elapsedTime time.Duration
}
@msurguy
msurguy / eloquent.md
Last active Feb 8, 2022
Laravel 4 Eloquent Cheat Sheet.
View eloquent.md

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

@ziadoz
ziadoz / awesome-php.md
Last active Jul 25, 2022
Awesome PHP — A curated list of amazingly awesome PHP libraries, resources and shiny things.
View awesome-php.md
@sterlingwes
sterlingwes / tourney.html
Created Dec 3, 2012
Tournament Bracket Generator (Javascript + CSS, no tables)
View tourney.html
<!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)