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
/* bad indentation is NetBeans' fault, camelCase is Propel's fault */ | |
var retrieveTeachers = function(query, process) { | |
// let them be json | |
var transformTeachers = function(teachers) { | |
return $.map(teachers, function(teacher) { | |
return { | |
id: teacher.Id, | |
FullName: (teacher.Name + ' ' + teacher.Surname), | |
// these functions allows Bootstrap typehead to use this item in places where it was expecting a string | |
toString: 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
/* | |
* Quorque tu, @fat. | |
* https://github.com/twitter/bootstrap/issues/1343 | |
*/ | |
$('[data-toggle=dropdown]').click(function() { | |
var parent = $(this).parent(); | |
if (!parent.hasClass('open') && parent.data('close-callback')) | |
{ //sta per aprirsi | |
parent.data('has-been-opened', true); | |
} |
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 | |
$palette = array( | |
'#DE3645','#F58759','#FBE25E','#B8D246','#129A77','#9CC3AD', | |
'#7DA1BF','#114477','#B086B9','#FAE1CB','#CAC4AE','#989899', | |
'#EBAE45', '#F58343' | |
); | |
// in a cycle | |
$count = 0; | |
foreach ($answers as $a) |
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
if (!console) | |
{ | |
var console = {}; | |
console.turnOff = function() | |
{ | |
var api = ['log', 'debug', 'info', 'warn', 'error', 'assert', 'dir', 'dirxml', 'trace', 'group', 'groupEnd', 'time', 'timeEnd', 'profile', 'profileEnd', 'count']; | |
for (var i = 0; i < api.length; i++) | |
console[ api[i] ] = function() { | |
}; | |
console.firebug = "0.00"; |
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
#!/bin/bash | |
# Check if user is root | |
if [ $(id -u) != "0" ]; then | |
echo "Error: You must be root to run this script, please use root to install the software." | |
exit 1 | |
fi | |
apt-get remove libtidy-0.99-0 tidy | |
apt-get install git-core automake libtool checkinstall |
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_extension=".".strtolower(pathinfo($_FILES["Filedata"]["name"],PATHINFO_EXTENSION)); |
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
/** | |
* Will evaluate all the keys of a given object containing a plus sign "+" | |
* to the expression result. | |
* | |
* example: | |
* var a = 2; | |
* var obj = { " 'hello' + a " : true }; | |
* rewriteProperties(obj); // returns { hello2: true } | |
* | |
*/ |
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
{% macro menuLinks(root, maxdepth) %} | |
{% import _self as macros %} | |
{# print a UL tree #} | |
{% for link in root.children %} | |
<li> | |
<a href="{{ link.slug }}">{{ link.name }}</a> | |
{% if link.children and (maxdepth > link.depth or not maxdepth) %} | |
<ul> | |
{{ macros.menuLinks(link, maxdepth) }} | |
</ul> |
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 wwwwrite () { | |
sudo setfacl -R -m u:www-data:rwX -m u:`whoami`:rwX $1 && sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx $1 | |
} |
OlderNewer