Skip to content

Instantly share code, notes, and snippets.

Design is a broad term used to refer to purpose, planning, or intention that exists or is thought to exist behind an action, fact, or material object. In the scope of Web Design we have 2 main partitions:
Front-end – dealing with user interface/interaction design (UX), and graphic design
Backend – dealing with behind the scenes data-processing software that runs on the server and also handles storage/manipulation of said data in congress with the cues from the front-end
Programming exists in both sects:
Front-end programming is rendered in the browser and therefore is both expanded and limited by the browser in use. This also means that commands are executed even after the page has loaded which lends well to it’s uses: handling user interaction and server communications involving user input along with executing visual-effects. Backend programming happens in the background, meaning the user never sees it happen. In fact your backend program is out of the picture by the time the page is loaded, handling t
//
Yii::app()->user->setFlash(BsHtml::ALERT_COLOR_WARNING,
'<strong>Warning!</strong> Best check yo self, you\'re not looking too good.');
$this->widget('gmfii.widgets.BsAlert');
$this->widget('gmfii.widgets.BsModal', array(
'id' => 'myModal',
'header' => 'Modal Heading',
'content' => '<p>One fine body...</p>',
// clientScript
Yii::app()->clientScript->registerCoreScript(); // used for libraries i.e jquery, backbone
//using resources from the main application:
$cssFile=Yii::app()->baseUrl."/css/mystyle.css";
$jsFile=Yii::app()->baseUrl."/js/myscript.css";
$cs=Yii::app()->clientScript;
//$cs->registerCssFile( URL, MEDIA);
$cs->registerCssFile($cssFile);
//$cs->registerScriptFile(URL, POSITION);
/** POSITION OPTIONS

Using CHtml::ajaxSubmitButton in active forms

<div class="form-group">
	<div class="col-sm-12 text-right">
		<?=
		CHtml::ajaxSubmitButton( Yii::t( 'zr', 'Add' ), [ 'createProperty' ],
			[
				'type'     => 'POST',
				'dataType' => 'json',

Helper class for notification messages

<?php
class Msg
{
	/**
	 * Add info message into queue.
	 * @param string $message info message
	 */
@b3457m0d3
b3457m0d3 / 0_reuse_code.js
Last active August 29, 2015 14:17
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@b3457m0d3
b3457m0d3 / Github-Webhooks-SSH
Last active August 29, 2015 14:12
use github webhooks to sync a repo with your server over ssh
<?
include('path/to/Net/SSH2.php');
$PATH = "/clone/into/path";
$REPO = "https://github.com/******/******.git";
if ( $_POST['payload'] ) {
$host='',$user='',$pass='';
$ssh = new Net_SSH2($host);
$ssh->login($user,$pass) or die("login failed");
echo $ssh->exec("cd {$PATH} && git clone {$REPO}");
}
@b3457m0d3
b3457m0d3 / fa-bs-rating-display
Created May 26, 2014 19:42
font awesome star rating display
<ul class="list-inline">
<li>&nbsp;<i class="fa fa-star-half-empty"></i>&nbsp;<b>Rating:</b></li>
<?php for($i=0;$i<5;$i++){ ?>
<?php if($i<$rating){ ?>
<li><i class="fa fa-star"></i></li>
<?php } else { ?>
<li><i class="fa fa-star-o"></i></li>
<?php } ?>
<?php } ?>
</ul>
@b3457m0d3
b3457m0d3 / vqmod-xml-temlpate
Created May 26, 2014 19:41
vqmod xml template
<modification>
<id><![CDATA[Name]]></id>
<version><![CDATA[1.0]]></version>
<vqmver><![CDATA[2.4.1]]></vqmver>
<author><![CDATA[Demo]]></author>
<file name="catalog/language/english/checkout/checkout.php">
<operation>
<search position="replace"><![CDATA[ line of code from checkout.php (you can search only 1 line)]]></search>
<add><![CDATA[New line/lines that will replace the searched one]]></add>
</operation>
@b3457m0d3
b3457m0d3 / bs-oc-breadcrumbs
Created May 26, 2014 04:44
bootstrap breadcrumbs for opencart
<!--// Breadcrumbs-->
<ol class="breadcrumb">
<?php $last = array_pop($breadcrumbs); ?>
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<li>
<a href="<?php echo $breadcrumb['href']; ?>">
<?php echo $breadcrumb['text']; ?>
</a>
</li>
<?php } ?>