Skip to content

Instantly share code, notes, and snippets.

View silentworks's full-sized avatar

Andrew Smith silentworks

View GitHub Profile
@christianhanvey
christianhanvey / modx-snippets.php
Last active December 8, 2024 18:46
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@markahesketh
markahesketh / gist:3895994
Created October 15, 2012 22:19
GIT SVN Workflow
## CLONE THE SVN
git svn clone -s <repo-url> Repository
## CREATING THE BRANCH REMOTELY AND LOCALLY
# Create the branch on the remote
git svn branch -m "BRANCH: Create DEV-branch_name - Description of branch" DEV-branch_name
# Create the branch locally
git checkout --track -b DEV-branch_name remotes/DEV-branch_name
@silentworks
silentworks / gist:3906028
Created October 17, 2012 15:04
Sublime Text 2 Shortcuts

Finding File Scope

cmd + alt + p - Mac

ctrl + alt + p - Windows

@iainurquhart
iainurquhart / gist:4093798
Created November 17, 2012 06:27
blx.entries
{% for entry in blx.entries.findEntries({ section: 'Blog', limit: '100', order: "postdate"}) %}
<li><a href="{{ entry.url }}">{{ entry.title }}</a></li>
{% endfor %}
anonymous
anonymous / gist:4263268
Created December 11, 2012 23:20
Simple Slim Framework Controllers
<?php
class App extends \Slim\Slim
{
public function mount($pattern, $method)
{
list($controller, $action) = explode('::', $method);
$app = $this;
return $this->map($pattern, function() use ($app, $controller, $action) {
@ziadoz
ziadoz / app-silex.php
Last active April 26, 2020 12:37
Slim Framework Controller Strategies (Simple/Silex)
<?php
// Silex Style Controllers
class App extends \Slim\Slim
{
public function mount($controller)
{
if (! is_object($controller)) {
throw new \InvalidArgumentException('Controller must be an object.');
}
@taylorlapeyre
taylorlapeyre / box.md
Last active December 16, 2015 09:29
Box Details

Every vagrant box starts out as a bare, minimal linux distribution. In our case, this was Ubuntu 12.04 LTS.

This page is a record of every command that was given to this base VM before it was repackaged as the lamp.box that we use. I've also included the vagrant commands used to generate it.

taylorlapeyre: vagrant init precise32
taylorlapeyre: vagrant ssh
# All passwords: "vagrant"
@michaelsauter
michaelsauter / BasePresenter.php
Last active December 15, 2024 21:55
Simple presenter pattern for Symfony2/Twig. Really useful to get some view logic out of the models and views into its own separate space.
<?php
namespace Acme\DemoBundle\Presenter;
class BasePresenter
{
protected $subject;
public function __construct($subject)
{
@ziadoz
ziadoz / eloquent.php
Last active November 28, 2018 14:40
Laravel 4 Eloquent ORM Standalone (Observers, Query Logging).
<?php
class Post
{
protected $table = 'posts';
/**
* You can define your own custom boot method.
*
* @return void
**/