Skip to content

Instantly share code, notes, and snippets.

/**
* Asset Url
* @return string
*/
function au()
{
static $url;
if ($url)
return $url;
return $url = app()->getAssetManager()->publish(ap(), false, 1, YII_DEBUG);
<?php
/**
*
* @package app.controller
*/
class TestController extends WebController
{
/**
*
@cornernote
cornernote / cache.php
Last active December 12, 2015 01:28
Simple Yii-Like Base Class for MySQL Tables
<?php
/**
* Cache class
*
* @author Brett O'Donnell - cornernote@gmail.com
* @copyright 2013, All Rights Reserved
*
*/
class cache
{
#!/bin/bash
#
# File: pingi
#
# Purpose: Ping Improved. Actually just handles better the timeout/unreachable.
#
# Author: BRAGA, Bruno <bruno.braga@gmail.com>
#
# Copyright:
#
<?php
$mepsenses = new MepSense('search');
$mepsenses->wordid = $data->wordid;
$mepsensesDataProvider = $mepsenses->search();
$this->widget('zii.widgets.CListView', array(
'dataProvider'=>$mepsensesDataProvider,
'itemView'=>'_senses',
));
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot PATH
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory PATH >
Options Indexes FollowSymLinks MultiViews
@cornernote
cornernote / MyModule.php
Created December 26, 2013 15:40
yii bootstrap looking module without yiistrap or booster
/**
* Initializes the audit module.
*/
public function init()
{
parent::init();
// setup paths
Yii::setPathOfAlias('audit', dirname(__FILE__));
$this->setImport(array(
@cornernote
cornernote / MyModel.php
Created January 13, 2014 06:12
recursive get parents
class MyModel extends CActiveRecord
{
public function relations()
{
return array(
'parent' => array(
self::BELONGS_TO,
'MyModel',
'parent_id',
/**
* AssetManager
*
* @author Brett O'Donnell <cornernote@gmail.com>
* @copyright 2013 Mr PHP
* @license BSD-3-Clause
*/
class AssetManager extends CAssetManager
{
gpg --list-keys
/root/.gnupg/pubring.gpg
------------------------
pub 1024D/2D15CE4F 2014-01-28
uid root <root@dom.ain>
sub 2048g/0B8C6ED2 2014-01-28