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 name, TIMESTAMPDIFF(DAY, DATE(FROM_UNIXTIME(date_start)), DATE(FROM_UNIXTIME(date_end))) + 1 AS duration | |
FROM some_table |
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
.rating { | |
border: none; | |
float: left; | |
} | |
.rating > input { display: none; } | |
.rating > label:before { | |
margin: 5px; | |
font-size: 1.25em; |
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 | |
/** | |
* Simple repository of common file mime types | |
*/ | |
class MIME { | |
private static $types = array( | |
'ai' => 'application/postscript', | |
'aif' => 'audio/x-aiff', | |
'aiff' => 'audio/x-aiff', |
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
lib.nav_with_search = COA_INT | |
lib.nav_with_search { | |
stdWrap.prefixComment = 2 | lib.searchbox | |
10 = TEXT | |
10.value = <ul class="sf-menu navbar-table"> | |
20 < lib.mainmenu | |
20 { |
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
var date = new Date('2015-10-21 15:54:44'); | |
var day = date.getDate(); | |
var month = date.getMonth() + 1; | |
var year = date.getFullYear(); | |
var hours = date.getHours(); | |
var minutes = date.getMinutes(); | |
var dateString = ('0' + day).slice(-2) + '.' + ('0' + month).slice(-2) + '.' + year + ' - ' + ('0' + hours).slice(-2) + ':' + ('0' + minutes).slice(-2); |
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 | |
/** | |
* @param string $file_name | |
* @param string $mime | |
* @param string/bool $download | |
* @return void | |
*/ | |
public function fileProxyAction($file_name, $mime, $download = false) { |
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 | |
public function scan_dir($dir, $contains = null, $sort = 'date', $ignored = array('.', '..', '.htaccess')) { | |
$files = array(); | |
$finfo = finfo_open(FILEINFO_MIME_TYPE); | |
foreach (scandir($dir) as $i => $file) { | |
preg_match('/'.$contains.'(\D)/', $file, $matches); | |
if (isset($contains) && is_string($contains) && count($matches) === 0) continue; | |
$files[$i] = array( |
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
$('[data-toggle=buttons] .btn > input[type=hidden]').each(function() { | |
if($(this).attr('name') == $(this).next().attr('name') || $(this).attr('name') + '[]' == $(this).next().attr('name')) | |
$(this).insertBefore($(this).parent().parent()); | |
}); |
NewerOlder