Skip to content

Instantly share code, notes, and snippets.

View Asyraf-wa's full-sized avatar

Asyraf Asyraf-wa

View GitHub Profile
@Asyraf-wa
Asyraf-wa / passwordMeter.ctp
Created December 30, 2016 07:23
Password meter (Entropizer)
//load entropizer css and js
<?php
echo $this->Html->css('jquery-entropizer');
echo $this->Html->script('entropizer.js');
echo $this->Html->script('jquery-entropizer.min.js');
?>
//password input
<div class="form-group">
<?php echo $this->Form->input('password', array(
@Asyraf-wa
Asyraf-wa / showPassword.ctp
Created December 30, 2016 07:47
Bootstrap Show Password Input
//load bootstrap show password script
<?php echo $this->Html->script('bootstrap-show-password.js'); ?>
//password input with data toggle
<div class="form-group">
<?php echo $this->Form->input('password', array(
'class' => 'form-control',
'placeholder' => 'Password',
'value' => '',
'label' => 'Password',
@Asyraf-wa
Asyraf-wa / clockPicker.ctp
Created December 30, 2016 07:56
Clock face TimePicker
//load clockpicker css and js
<?php
echo $this->Html->css('clockpicker');
echo $this->Html->css('standalone');
echo $this->Html->script('clockpicker.js');
?>
//time input
<div class="form-group">
<?php echo $this->Form->input('start_time', array(
@Asyraf-wa
Asyraf-wa / dateTimePicker.ctp
Created December 30, 2016 09:17
Date Time Picker (Calendar)
//load dateTimePicker css and js
<?php
echo $this->Html->css('jquery.datetimepicker');
echo $this->Html->script('jquery.datetimepicker.full.js');
?>
//date input
<div class="form-group">
<?php echo $this->Form->input('visit_date', array(
'class' => 'form-control datepicker-here',
@Asyraf-wa
Asyraf-wa / easyPieChart.ctp
Created December 30, 2016 09:21
Pie Chart (easyPieChart)
//load easypiechart js
<?php
echo $this->Html->script('jquery.easypiechart.js');
echo $this->Html->script('jquery.easing.min.js');
?>
//display JSON output
<span class="chart" data-percent="<?php echo json_encode($your_calculated_variable); ?>">
<span class="percent"></span>
</span>
@Asyraf-wa
Asyraf-wa / select2.ctp
Created December 30, 2016 09:27
Select2 for options
//load select2 css and js
<?php
echo $this->Html->css('select2');
echo $this->Html->script('select2.js');
?>
//js function
<script type="text/javascript">
$(document).ready(function() {
$(".faculty").select2();
@Asyraf-wa
Asyraf-wa / ckEditor.ctp
Created December 30, 2016 09:31
CKeditor integration
//load ckeditor js
<?php echo $this->Html->script('ckeditor/ckeditor'); ?>
//input for textbox with ckeditor
<div class="form-group">
<?php echo $this->Form->input('note', array(
'class' => 'form-control',
'label' => 'Note',
'class' => 'ckeditor'
));
@Asyraf-wa
Asyraf-wa / morphext.ctp
Created December 30, 2016 09:35
Text Rotator (morphext)
//load animate, morphtext css and js
<?php
echo $this->Html->css('animate');
echo $this->Html->css('morphext');
echo $this->Html->script('morphext.min.js');
?>
...It is <span id="js-rotating">Good, Fast, Nice</span> to be used...
<script>
@Asyraf-wa
Asyraf-wa / meta-tags.md
Created April 20, 2018 13:11 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@Asyraf-wa
Asyraf-wa / test.php
Created November 26, 2018 01:38
Asyraf-wa
//capture by session
if ($this->request->is('post')) {
$this->Session->write('name', $this->request->data['Department']['name']);
//read session
<?php echo $this->Session->read('name'); ?>
<?php echo $this->Form->input('name2', array('class' => 'form-control',
'value' => $this->Session->read('name')));?>