Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
@silentworks
silentworks / Category.php
Created September 26, 2014 12:42
October column list
<?php namespace Silent\Works\Models;
use Model;
/**
* Category Model
*/
class Category extends Model
{
<?php
namespace Serraphyn;
class HomeController {
public functionn index () {
echo 'Hello World';
}
}
@silentworks
silentworks / doctrine
Created November 2, 2014 21:18
Doctrine Migrations
#!/usr/bin/env php
<?php
date_default_timezone_set('UTC');
require __DIR__ . '/../vendor/autoload.php';
use Symfony\Component\Console\Application;
use DoctrineMigrationsHelper\CommandSet;
use Doctrine\DBAL;
$dbConfig = require __DIR__ . '/../config/database.php';
@silentworks
silentworks / Gulpfile.js
Created November 22, 2014 21:13
gulp sass setup for sourcemaps
var gulp = require('gulp');
var sass = require('gulp-sass');
var sourcemaps = require('gulp-sourcemaps');
var config = {
sass: {
includePaths: [],
sourceMap: true
}
};
<?php
use AlanPich\Configurator;
use AlanPich\Configurator\FileTypeAdapter;
$PROJECT_ROOT = dirname(__FILE__);
define('ENVIRONMENT', 'development');
///////////////////////////////////////////////////////////////////////////////
pagebinding:
path: /blog/{slug}
defaults: { _controller: 'Bolt\Controllers\Frontend::record', 'contenttypeslug': 'post' }
contenttype: posts
pagebinding:
path: /{slug}
defaults: { _controller: 'Bolt\Controllers\Frontend::record', 'contenttypeslug': 'page' }
contenttype: pages
<?php
/*
* This file is part of the MODSlim package.
*
* Copyright (c) Jason Coward <jason@opengeek.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
<?php
class TestController
{
public function __construct(\Spot\MapperInterface $user, $view)
{
$this->user = $user;
$this->view = $view;
}
@silentworks
silentworks / disqus.php
Created February 24, 2011 20:38
fix issue within Wordpress 3.1 edit panel and frontend view.
// Mark entries in index to replace comments link.
/* Patched with version check for WP 3.1 */
function dsq_comments_number($count) {
global $post, $wp_version;
$ver_check = explode('.', $wp_version);
if($ver_check[0] <= 3 && $ver_check[1] < 1){
if ( dsq_can_replace() ) {
return '<span class="dsq-postid" rel="'.htmlspecialchars(dsq_identifier_for_post($post)).'">'.$count.'</span>';
} else {
<?php if( ! empty($feed)): ?>
<?php foreach ($feed as $row):?>
<?php if ($row->content_category == 'news') { ?>
<li class="news">
<a class="title" href="<?php echo site_url('news') . '/' . $row->content_id . '/' . $row->content_url; ?>"><h2><?php echo $row->content_title; ?></h2></a>
<p class="created">News from <a href="<?php echo creator($row->content_parent, 'url'); ?>"><?php echo creator($row->content_parent, 'title'); ?></a></p>