This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->load->module('dashboard'); | |
$this->dashboard->method(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// File and new size | |
$filename = 'test.jpg'; | |
$percent = 0.5; | |
// Content type | |
header('Content-Type: image/jpeg'); | |
// Get new sizes | |
list($width, $height) = getimagesize($filename); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT `post_title` FROM bf_article_posts AS r1 JOIN (SELECT CEIL(RAND() * (SELECT MAX(id) FROM bf_article_posts)) AS id) AS r2 WHERE r1.id >= r2.id ORDER BY r1.id ASC LIMIT 10 | |
#https://stackoverflow.com/questions/4329396/mysql-select-10-random-rows-from-600k-rows-fast | |
#http://jan.kneschke.de/projects/mysql/order-by-rand/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE TABLE_NAME SET post_slug = LOWER(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(TRIM(post_title), ':', ''), '’', ''), ')', ''), '(', ''), ',', ''), '\\', ''), '\/', ''), '\"', ''), '?', ''), '\'', ''), '&', ''), '!', ''), '.', ''), ' ', '-'), '--', '-'), '--', '-')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
array_values($array)[0]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BFPATH - > '/bonefire/' | |
FCPATH -> '/public/' | |
BASEPATH -> '/system/' | |
//in CI_Bonfire : /bonfire/ci3/ | |
APPPATH -> '/application/' | |
#return filename | |
basename($path); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span class="help-block"><a rel="featured_image_popover" href="<?=$data['post_featured_image'];?>" data-img="<?=$data['post_featured_image'];?>" target="_blank">image's URL</a></span> | |
$('a[rel=featured_image_popover]').popover({ | |
html: true, | |
trigger: 'hover', | |
placement: 'bottom', | |
content: function () { return '<img class="img-responsive" src="' + $(this).data('img') + '" />'; } | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" | |
xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" | |
xmlns:video="http://www.google.com/schemas/sitemap-video/1.1"> | |
<url> | |
<loc>http://www.example.com/foo.html</loc> | |
<image:image> | |
<image:loc>http://example.com/image.jpg</image:loc> | |
<image:caption>Dogs playing poker</image:caption> | |
</image:image> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.container { | |
position: relative; | |
width: 100%; | |
height: 0; | |
padding-bottom: 56.25%; | |
} | |
.video { | |
position: absolute; | |
top: 0; | |
left: 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Initialize variable for database credentials | |
$dbhost = 'hostname'; | |
$dbuser = 'username'; | |
$dbpass = 'password'; | |
$dbname = 'sakila'; | |
//Create database connection | |
$dblink = new mysqli($dbhost, $dbuser, $dbpass, $dbname); |