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
| # Clone convert-swf | |
| $ git clone https://github.com/vsoch/convert-swf.git | |
| $ cd convert-swf | |
| # Build the image | |
| $ docker build -t vanessa/convert-swf . | |
| # Run the container | |
| $ docker run -it --entrypoint '' -v ${PWD}/:/data vanessa/convert-swf bash |
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
| // Add class text-content to have the proper styles | |
| document.getElementById('content').classList.add('text-content'); | |
| // Update header's ID | |
| var headers = document.querySelectorAll('h1,h2,h3,h4,h5,h6'); | |
| for(var i=0; i<headers.length; i++) { | |
| var h = headers[i], | |
| id = h.getAttribute('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
| document.body.addEventListener('load', function(e){ | |
| if(e.target.tagName == 'IMG'){ | |
| e.target.style.visibility = "visible"; | |
| } | |
| }, true); // <-- useCapture |
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
| { | |
| // http://eslint.org/docs/rules/ | |
| "ecmaFeatures": { | |
| "binaryLiterals": false, // enable binary literals | |
| "blockBindings": false, // enable let and const (aka block bindings) | |
| "defaultParams": false, // enable default function parameters | |
| "forOf": false, // enable for-of loops | |
| "generators": false, // enable generators | |
| "objectLiteralComputedProperties": false, // enable computed object literal property names |
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 | |
| /** | |
| * Add the search box to the wordpress header (front) | |
| */ | |
| function add_search_box($nav, $args) { | |
| if($args->theme_location != 'top' ) { | |
| return; | |
| } | |
| ob_start(); | |
| get_search_form(); |
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 | |
| /** | |
| * Tirage aléatoire d'un élément selon des probabilités définies | |
| * Ex : | |
| * // 20% de proba de retourner la valeur x, 15% pour y, etc | |
| * array_rand_proba(array('x' => 20, 'y' => 15, 'z' => 35, 't' => 30 | |
| * )) | |
| * | |
| * @param array $proba - Liste de valeurs associées à la probabilité de la tirer | |
| * @return string - Valeur tirée au hasard |
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
| {assign var=images value='/,\s*/'|preg_split:'imga.png, imgb.png, imgc.png'} | |
| {assign var=randomindex value=$images|@array_rand} | |
| <div class="partenaire"> | |
| <img src="{$images.$randomindex}" border="0" alt="Image" height="32"> | |
| </div> |
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
| # | |
| # Configuration File for JavaScript Lint 0.2.6 | |
| # Developed by Matthias Miller (http://www.JavaScriptLint.com) | |
| # | |
| # This configuration file can be used to lint a collection of scripts, or to enable | |
| # or disable warnings for scripts that are linted via the command line. | |
| # | |
| #### NOTE TO TEXTMATE BUNDLE USERS: | |
| #### Feel free to experiment with enabling/disabling individual warnings to |
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
| // Highlight current page menu item as user scrolls | |
| var lastId, | |
| pageMenu = $(".nav"), | |
| pageMenuHeight = pageMenu.outerHeight() + 126, | |
| // All list items | |
| menuItems = pageMenu.find("a"), | |
| // Anchors corresponding to menu items | |
| scrollItems = menuItems.map(function(){ | |
| var item = $($(this).attr("href")); | |
| if (item.length) { return item; } |
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
| // String utils | |
| // | |
| // resources: | |
| // -- mout, https://github.com/mout/mout/tree/master/src/string | |
| /** | |
| * "Safer" String.toLowerCase() | |
| */ | |
| function lowerCase(str){ | |
| return str.toLowerCase(); |