Skip to content

Instantly share code, notes, and snippets.

@131digital
131digital / 0_reuse_code.js
Created May 10, 2014 21:00
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
@131digital
131digital / multi-select-dropdown
Created March 29, 2014 17:25
Codeigniter - Populate multi select dropdown from database
<?php
// put in controller
$vendor_categories = $this->vendor_category_model->get_many_by('vendorid',$id);
// get the category the vendor belongs to
$vendorcat = array();
foreach($vendor_categories as $vendor_category => $value){
$vendorcat[$value->categoryid] = $value->categoryid;
}
//data array for view
@131digital
131digital / google-analytics.php
Created February 8, 2014 19:30
google-analytics
<?php
//Get Google Analytic ID
$ar_ga_id = get_option('ar_ga_id');
if(!empty($ar_ga_id))
{
?>
<script type="text/javascript">
@131digital
131digital / timthumb.php
Last active August 29, 2015 13:56
timthumb
<?php
/*
TimThumb script created by Tim McDaniels and Darren Hoyt with tweaks by Ben Gillbanks
http://code.google.com/p/timthumb/
MIT License: http://www.opensource.org/licenses/mit-license.php
Paramters
---------
w: width