Skip to content

Instantly share code, notes, and snippets.

View BuddhiKasun's full-sized avatar

Buddhi Kasun BuddhiKasun

View GitHub Profile
@BuddhiKasun
BuddhiKasun / Model_Admin.php
Created November 29, 2017 07:35
Dynamic CRUD Model Functions
<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Model_Admin extends CI_Model{
public function insertDataToDatabase($tableName, $data)
{
$this->db->insert($tableName, $data);
}
public function updateDataInDatabase($column, $tableName, $data, $id)
<?php
// iterate through multidimensional arrays
// two level deep
$array = array( 'levelone-key1' => 'levelone-value1',
'levelone-key2' => array('sublevel-key' => 'sublevel-value'),
'levelone-key3' => 'levelone-value3',
);
function twoLevelArray($array)
@BuddhiKasun
BuddhiKasun / Atom bracket-matcher color
Created January 17, 2016 19:45
Atom bracket-matcher color
Atom bracket-matcher
-----------------------
atom-text-editor::shadow .bracket-matcher .region {
border: 1px solid rgba(222, 149, 54, 0.6);
border-radius: 3px;
background-color: rgba(255, 217, 0, 0.3);
z-index: 100;
}