Skip to content

Instantly share code, notes, and snippets.

$events_query = new WP_Query('category_name=event&orderby=meta_value_num&order=ASC&meta_key=post_singleton_date&meta_compare=>=&meta_value=' . strtotime(date('d-m-Y')));
$attachments = new Attachments( 'attachments', $post->ID );
if( $attachments->exist() ) :
$attachment->get_single(0);
cats = get_the_terms($post->ID, 'portfolio_categories');?>
<li>
<a href="">
//cant do the below because it just wont work
<?php echo $attachment->image( 'portfolio-small' ); ?>
<div class="project-content">
<h3><?php the_title() ?></h3>
@dannewns
dannewns / gist:8041051
Created December 19, 2013 15:33
ok this is probably totally wrong i know i should assign a tag in the if statment to the label and then outside of the if get the label by tag and then assign the value
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"EventCell" forIndexPath:indexPath];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"EventCell"];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(34.0f, 34.0f, tableView.frame.size.width, 130.f)];
label.textAlignment = NSTextAlignmentLeft;

Logo

Now Hiring: ParkatmyHouse.com

At ParkatmyHouse.com we are looking to expand our small team to include a number of new development positions ahead of a major project. Go ahead and take a look at the role descriptions. If the must haves don't quite fit, let us know anyway, you never know!


Front-end Developer

Must have

<?php namespace Patina\Extensions;
use Illuminate\Http\Request;
use Illuminate\Routing\Route;
use Symfony\Component\HttpKernel\Exception\UnauthorizedHttpException;
class PatinaApiAuthenticationProvider extends \Dingo\Api\Auth\Provider {
/**
* Illuminate authentication manager.
@dannewns
dannewns / gist:a823b72a61f315710844
Created November 19, 2014 12:46
Repository Version
Route::get('{something}/csv', ['uses' => 'SomeController@getCSV', 'as' => 'csv.get']);
SomeController {
public function getCSV($something)
{
$csv = $this->csv_repository->find($something);
/**
* Mutators
*/
public function setEmailAttribute($value)
{
$value = \Import::splitMultipleFieldsData($value);
$this->setEmailAddressesAttribute($value);
}
$args = array('post_type' => 'review', 'post_status' => 'publish', 'orderby' => 'rand', 'per_page' => 1);
$review = new WP_Query();
$review = $review->query($args);
//Current
$devices = $cube->get('devices/');
//Just wondering if it might be worth having some common methods such as
$devices = $cube->devices();
$device = $cube->getDevice($deviceId);
#I currently have this method that returns a list of reads from a cube.
/**
* returns the current reads for the device id passed to it
* @param string $device_id the device uid to use
* @return array the device current reads from the API
*/
public function getDeviceCurrentReads($device_id = NULL)
{
if (is_null($device_id)) return NULL;