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
<!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> |
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
# 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 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 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 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 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 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 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
function print_r(obj) { | |
win_print_r = window.open('about:blank', 'win_print_r'); | |
win_print_r.document.write('<html><body>'); | |
r_print_r(obj, win_print_r); | |
win_print_r.document.write('</body></html>'); | |
} | |
function r_print_r(theObj, win_print_r) { | |
if(theObj.constructor == Array || theObj.constructor == Object){ | |
if (win_print_r == null) |
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
alias sadd="svn status |grep '\?' |awk '{print $2}'| xargs svn add" | |
alias grepf="grep --exclude=*.svn-base --exclude-dir=\.svn --exclude=*~ " | |
svndiff() | |
{ | |
svn diff "${@}" | colordiff | |
} |
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
{* Button to create a new content *} | |
<form action="/content/action" method="post"> | |
{* set the class identifier to use *} | |
<input type="hidden" name="ClassIdentifier" value="article"> | |
{* set the language to use *} | |
<input type="hidden" name="ContentLanguageCode" value="fre-FR"> | |
{* set the parent node id to use *} | |
<input type="hidden" name="NodeID" value="{$module_result.node_id}"> | |
<input class="button" type="submit" value="Create a new content under this one" name="NewButton"> | |
</form> |
OlderNewer