Skip to content

Instantly share code, notes, and snippets.

View iammerrick's full-sized avatar

Merrick Christensen iammerrick

View GitHub Profile
function sexy_json()
{
$regions = function(){
$array = array();
$regions = new Pod('regions');
$regions->findRecords('name ASC');
while($regions->fetchRecord())
{
array_push($array, $regions->get_field('name'));
<?php
$array = array(
'name' => 'Kenneth'
);
$array = (Object)$array;
echo $array->name;
[myapp.com/login]
[myapp.com/client] // Same application as /login
[myapp.com/admin] // Separate application
<?php
try
{
$user = ORM::factory('user');
$user->name = 'Merrick';
$user->save();
$profile = ORM::factory('profile');
$profile->name = 'What up.';
<?php
public function create_user_and_landlord($values)
{
$this->_db->begin();
$errors = NULL;
try
{
$this->values($_POST, $this->form_fields());
<?php
/**
* Try creating the user, commit a transaction.
*
* @author Merrick Christensen
*/
try
{
$user = ORM::factory('user')
->create_user($_POST, array(
SlideShow.Controls = new Class({
Extends: SlideShow,
options: {
controlsSelector: '',
controlSyntax: 'li a[href=#]'
},
setupSlides: function(){
<?php
Route::set('help', 'help(/<id>)',
array(
'path' => '[a-zA-Z0-9_/]+',
))
->defaults(array(
'controller' => 'help',
'action' => 'index',
));
@iammerrick
iammerrick / gist:869402
Created March 14, 2011 16:21
Background Image minus replace text.
@mixin wallpaper($image, $block:false){
width: image-width($image);
height: image-height($image);
background: image-url($image);
@if $block != false{
display: block;
}
}
@iammerrick
iammerrick / Bubble.js
Created March 17, 2011 22:04
Basic tooltip like plugin.
$.fn.bubble = function(options){
/* Initialize base variables */
var settings = {
offset : {
left: 0,
top: 0
},
action: 'click' // Event to toggle bubble
},