Skip to content

Instantly share code, notes, and snippets.

<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
class Car {
protected $color = 'White';
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
class Car {
private $color = 'White';
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
class Car {
public $color = 'White';
@cesarkohl
cesarkohl / gulpfile.js
Created August 1, 2019 00:15
Gulp / Pug
var gulp = require('gulp');
var pug = require('gulp-pug');
var less = require ('gulp-sass');
gulp.task('pug', function() {
return gulp
.src('*/*.pug')
.pipe(pug())
.pipe(gulp.dest('build'));
});
function number_format(number, decimals, dec_point, thousands_sep) {
var number = (number + '').replace(/[^0-9+\-Ee.]/g, '');
var n = !isFinite(+number) ? 0 : +number,
prec = !isFinite(+decimals) ? 0 : Math.abs(decimals),
sep = (typeof thousands_sep === 'undefined') ? ',' : thousands_sep,
dec = (typeof dec_point === 'undefined') ? '.' : dec_point,
s = '',
toFixedFix = function (n, prec) {
var k = Math.pow(10, prec);
return '' + (Math.round(n * k) / k).toFixed(prec);
@cesarkohl
cesarkohl / fixed-menu
Created October 4, 2015 01:38
jQuery fixed menu
// Fixed Menu
slider($(window).height());
$(window).scroll(function () {
slider($(window).height());
});
function slider(vh_height) {
console.log('scrollTop: '+ document.body.scrollTop +' | vh_height: '+vh_height);
if (document.body.scrollTop > vh_height)
$('nav.navbar').stop().animate({ top: 0 }, 200);
@cesarkohl
cesarkohl / jquery-anchor-fade
Created October 3, 2015 21:54
jQuery - Anchor section with fade
/**
* Anchor with fade
* Example: <a href="#example-1"/> <div id="example-2"/>
*/
$('a.scroll-smooth').on('click',function (e) {
e.preventDefault();
var target = this.hash;
var $target = $(target);
@cesarkohl
cesarkohl / bootstrap-dropdown-hover
Created October 3, 2015 21:52
Bootstrap dropdown hover
@media screen and (min-width: 780px) {
.dropdown:hover .dropdown-menu { display: block; } /* enable hover dropdown */
}
@cesarkohl
cesarkohl / css-fullscreen-section
Created September 11, 2015 17:17
CSS fullscreen section
.full-height { height: 100vh; }
@cesarkohl
cesarkohl / bootstrap-centered-site
Created September 10, 2015 18:02
Bootstrap centered site
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="container">
<div class="row">
<!-- Content columns -->
<div class="col-lg-12">
<!-- Content -->
</div>
</div>