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
| javascript: function loadScripts(array, callback) { | |
| var loader = function(src, handler) { | |
| var script = document.createElement("script"); | |
| script.src = src; | |
| script.onload = script.onreadystatechange = function() { | |
| script.onreadystatechange = script.onload = null; | |
| handler(); | |
| }; | |
| var head = document.getElementsByTagName("head")[0]; | |
| (head || document.body).appendChild(script); |
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 edit () | |
| { | |
| $model = new Article(); | |
| $form = new DataForm($model); //--> $form->model | |
| $form->text('title'); | |
| $form->text('author.name'); |
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
| 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 | |
| } |
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
| {% 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 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
| /** | |
| * 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 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 | |
| $file_extension=".".strtolower(pathinfo($_FILES["Filedata"]["name"],PATHINFO_EXTENSION)); |
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
| #!/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 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
| 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 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 | |
| $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) |