Skip to content

Instantly share code, notes, and snippets.

View iammerrick's full-sized avatar

Merrick Christensen iammerrick

View GitHub Profile
<?php
$past_months_total = DB::query(Database::SELECT, 'SELECT COUNT(*) as uploaded FROM `photos`
WHERE `photos`.`created`
BETWEEN DATE_SUB(NOW(), INTERVAL 30 DAY) AND NOW()
AND `photos`.`user_id` = '. $this->user->id)->execute();
sudo node run.js
5 Nov 23:22:15 - socket.io ready - accepting connections
Error: ECONNREFUSED, Connection refused
at Stream._onConnect (net.js:687:18)
at IOWatcher.onWritable [as callback] (net.js:284:12)
at node.js:616:9
<?php defined('SYSPATH') or die('No direct script access.');
class Model_User extends Model_Auth_User {
protected $_has_many = array(
'user_tokens' => array('model' => 'user_token'),
'roles' => array('model' => 'role', 'through' => 'roles_users'),
);
protected $_rules = array(
{
"requirements" : [
"php" : [
"PHP5",
"Working With Databases",
"WordPress"
],
"javascript" : [
"jQuery"
Route::set('manage', 'manage/(<resource_id>/(/<controller>(/<action>(/<id>))))')
->defaults(array(
'controller' => 'tenants',
'action' => 'index'
));
ABOUT US:
http://risermedia.com
We’re a full service graphic design agency with high profile clients (ABC, National Geographic, NBC, ABC Family, Warner Bros., TV Guide and more). We’re young, hip, and super passionate about our work.
We absolutely despise micro-management. We want people like us who love what they do and do it well. We'll let Basecamp manage the little details so you can turn out stellar code in peace - without some old-school jerk barking over your shoulder!
We’re located in American Fork, so anywhere in happy valley or SLC is close enough to commute.
-----------------------------------------
ABOUT US (RISERMEDIA.COM):
-----------------------------------------
We’re a full service graphic design agency with high profile clients (ABC, National Geographic, NBC, ABC Family, Warner Bros., TV Guide and more). We’re young, hip, and super passionate about our work.
We absolutely despise micro-management. We want people like us who love what they do and do it well. We'll let Basecamp manage the little details so you can turn out stellar code in peace - without some old-school jerk barking over your shoulder!
We’re located in American Fork, so anywhere in happy valley or SLC is close enough to commute (we do not work remotely).
-----------------------------------------
@iammerrick
iammerrick / SCSS & Operator
Created November 15, 2010 18:39
The ampersand with reference the parent selector. Mmmm....
// SCSS
a{
color: #ff0000;
&:hover{
color: #660000;
}
}
input{
&.submit{
}
&.text{
}
&.radio{
}
}
// Returns "?sort=title&limit=10" combined with any existing GET values
$query = URL::query(array('sort' => 'title', 'limit' => 10));
public static function query(array $params = NULL)
{
if ($params === NULL)
{
// Use only the current parameters
$params = $_GET;