Skip to content

Instantly share code, notes, and snippets.

View Tim-Machine's full-sized avatar

Tim Smith Tim-Machine

  • Cohezion.ai
  • Cary,NC
  • 04:30 (UTC -04:00)
View GitHub Profile
@Tim-Machine
Tim-Machine / gist:3644402
Created September 5, 2012 20:41
protect your yaml
<Files ~ "^\.yaml">
Order allow,deny
Deny from all
</Files>
DirectoryIndex index.html, index.html
<!--- LEFT NAVIGATION W/ THUMBNAILS --->
<div class="leftnav">
<div class="addViews">
<h3 class="optima"> additional views </h3>
<img src="${ms.urlPathNoProtocol}/imagesnew/product/alt/altBracketTop.png" alt="top" />
oil generate admin controller1
# works fine no issues
oil generate admin controller2
#failes ./././././base.php already exists, use -f, or --force to override.
#I don't want to override the base.php
@Tim-Machine
Tim-Machine / gist:3975994
Created October 29, 2012 19:36
possible parser / template engine
<div id="blogroll" data-type='blog' data-limit="6" data-sortBy="date" data-order="DESC">
<div class="title">{{title}}</div>
<div class="date">{{date :format[m-d-y]}}</div>
<div class="author">{{author}}</div>
<div class="entry">{{entry}}</div>
</div>
@Tim-Machine
Tim-Machine / less.css
Created November 10, 2012 15:54
less examples
<!-- ugly bootstrap classes in your html -->
<div class="row">
<div class="span6">...</div>
<div class="span6">...</div>
</div>
<!- our new, semanticized HTML -->
<article>
<section class="main">...</section>
@Tim-Machine
Tim-Machine / robot.js
Created December 11, 2012 20:04
DeathAng3l2
// Conventions:
// We use angles in degrees in clock-wise fashion
RobotHelpers = {};
MathHelpers = {};
RobotHelpers.cannon_rotation_direction = {};
RobotHelpers.shoot = {};
RobotHelpers.target = {};
RobotHelpers.moving_direction = {};
@Tim-Machine
Tim-Machine / example.php
Created May 30, 2013 19:28
example of non working blade/theme/controller layout configuration If you remove sidebar content works. If sidebar is there "variable 'content' cant be found"
<?php
class ExampleController extends BaseController{
protected $layout = "master.layout"
protected $themePath = "/some/path/"
funcion index()
{
$data['user'] = "some user"
View::addNamespace('theme', $this->themePath);
<!--
Example URL
www.mysite.com/templategroup/subtemplate/segment3
-->
{exp:channel:entries channel="SnactivityDetailsChannel" limit="1" url_title="{segment_3}" }
<h2>{title}</h2>
{if no_results}
public function submit_entry()
{
$this->initialize();
// Get hidden meta vars
if ( ! isset($_POST['meta']))
{
// This should never be valid
return;
}
<?php
$webRoot = $_SERVER['DOCUMENT_ROOT']; // root of our web site.
define("DS", DIRECTORY_SEPARATOR ); // this is to account for OS direcorty separator differences
require_once $webroot.DS."this{$DS}is{$DS}a{$DS}path{$DS}to{$DS}a{$DS}folder";