This file contains hidden or 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 alertFallback = false; // enable it if you wanna see alerts msg | |
| if (typeof console === "undefined" || typeof console.log === "undefined") { | |
| console = {}; | |
| if (alertFallback) { | |
| console.log = function(msg) { | |
| alert(msg); | |
| }; | |
| } else { | |
| console.log = function() {}; | |
| } |
This file contains hidden or 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 | |
| class StrUtils { | |
| static function slug($str){ | |
| $str = strtolower($str); | |
| $str = self::remove_accent($str); | |
| return preg_replace(array('/[^a-zA-Z0-9 \'-]/', '/[ -\']+/', '/^-|-$/'), | |
| array('', '-', ''), $str); | |
| } |
This file contains hidden or 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 | |
| function subval_sort($array, $subkey) { | |
| foreach($array as $key => $value) { | |
| $new_array[$key] = strtolower($value[$subkey]); | |
| } | |
| asort($new_array); | |
| foreach($new_array as $new_key => $new_val) { | |
| $result[$new_key] = $array[$new_key]; | |
| } |
This file contains hidden or 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 | |
| static function mysql_timediff( $datefield, $date_to_compare, $tbl, $cond_field, $cond_value ) { | |
| $db = eZDB::instance(); | |
| $sql = "SELECT TIMEDIFF($datefield, $date_to_compare ) FROM $tbl WHERE $cond_field = '$cond_value';"; | |
| $rows = $db->arrayQuery( $sql ); | |
| return $rows[0]; | |
| } | |
| ?> |
This file contains hidden or 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
| <ul> | |
| <li class="opened"> | |
| <a href="">Item 1</a> | |
| <ul class="submenu"> | |
| <li>Sub item 1</li> | |
| <li>Sub item 2</li> | |
| <li>Sub item 3</li> | |
| <li>Sub item 4</li> | |
| </ul> | |
| </li> |
This file contains hidden or 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
| # Prompt | |
| PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\[\033[01;34m\]$(__git_ps1 "(%s)")\[\033[00m\]\$ ' | |
| git config apply.whitespace=fix | |
| git config apply.ignorewhitespace on | |
| # ~/.gitconfig | |
| [core] | |
| editor = vim | |
| [alias] |
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | |
| <title>Simple JS Popin</title> | |
| <link href="style.css" rel="stylesheet" type="text/css" /> | |
| <script src="script.js" type="text/javascript"></script> | |
| </head> | |
| <body> |
NewerOlder