Skip to content

Instantly share code, notes, and snippets.

View anaspk's full-sized avatar

Muhammad Anas anaspk

View GitHub Profile
@anaspk
anaspk / prepare-column-names-for-sql.php
Last active June 21, 2017 12:21
Paste a list of column names copied from Oracle SQL Developer and get a string back to use in the SELECT clause of your SQL queries
<?php
// If you select and copy the names of columns of a table from Oracle SQL Developer,
// you will get something like this.
$column_names = 'ACCOUNT_ID
COMMENTS
POST_DATE';
// But in PHP, we normaly select columns with the aliases in lower case like so:
// column_name "column_name"
@anaspk
anaspk / index.php
Last active August 29, 2015 14:07
Illustrating difference between index.php and taxonomy archive templates in WordPress
<?php get_header(); ?>
<div class="container">
<?php
if (function_exists('yoast_breadcrumb')) {
yoast_breadcrumb('<div class="book-breadcrumb"><p><span class="glyphicon glyphicon-home"></span>&nbsp;', '</p></div>');
}
?>
<div class="row">
<div class="col-sm-5 col-md-4">
<?php get_sidebar(); ?>
@anaspk
anaspk / yii-rbac-tables-migration.php
Last active January 3, 2016 18:09
A Yii migration to create RBAC tables in the currently configured database.
<?php
class m140108_152635_create_rbac_tables extends CDbMigration {
public function up() {
$this->createTable('AuthItem', array(
'name' => 'string NOT NULL',
'type' => 'integer NOT NULL',
'description' => 'text',
'bizrule' => 'text',