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
| <!-- Circular bar --> | |
| <ProgressBar | |
| style="@style/Base.Widget.AppCompat.ProgressBar" | |
| android:layout_width="match_parent" | |
| android:layout_height="wrap_content" | |
| android:indeterminate="true" | |
| android:indeterminateTint="@color/colorAccent" | |
| android:indeterminateTintMode="src_atop" | |
| android:visibility="visible" /> | |
| <!-- Linear bar --> |
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
| /// <reference path="../../../../typings/jquery/jquery.d.ts" /> | |
| // TODO: Create date picker directive | |
| declare var jQuery: JQueryStatic; | |
| export class Main implements OnInit { | |
| public date: any; | |
| constructor() { | |
| this.date = '2016-04-29'; | |
| } |
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 binaryGapFnc(N) { | |
| var binary = N.toString(2); | |
| var regex = /10+1/g | |
| var matches = binary.match(regex); | |
| if(!matches) { return 0; } | |
| var binaryGap = 0; | |
| for(var i = 0; i < matches.length; i++) { | |
| if (matches[i].length > binaryGap) { |
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
| Math.roundTo = (number, precision) -> | |
| Math.round(number * 10**precision) / 10**precision |
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
| docker inspect --format '{{ .NetworkSettings.IPAddress }}' <container-id-or-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
| #!/usr/bin/env ruby | |
| require 'json' | |
| require 'fileutils' | |
| include FileUtils | |
| # Parses the argument array _args_, according to the pattern _s_, to | |
| # retrieve the single character command line options from it. If _s_ is | |
| # 'xy:' an option '-x' without an option argument is searched, and an | |
| # option '-y foo' with an option argument ('foo'). |
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 // formulario.php | |
| // Para saber a donde apunta el formulario fijate en el atributo action del form: | |
| <form action="server/script.php" name='nombre_formulario'> | |
| </form> | |
| ?> | |
| <?php /* server/script.php */ // Aquí es a donde llega el form anterior | |
| if (isset($_POST['nombre_formulario'])) { |
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 | |
| $array = [null, 1, null, 2, 3, 5]; | |
| var_dump(array_filter($array)); | |
| // This also works for numeric index values, notice how the null value indexes are stripped | |
| $array = [ | |
| 0 => null, | |
| 1 => 22, | |
| 2 => null, | |
| 3 => 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
| <?php | |
| // This will allow you to use any view helper in any class such as a controller // | |
| // 1. Instantiate the view helper. | |
| // 2. Configure it. | |
| // 3. Use it. | |
| // E.g. Use currency formatter | |
| $currencyFormatter = new CurrencyFormat(); | |
| $currencyFormatter->setCurrencyCode('USD'); | |
| $currencyFormatter->setLocale('en_US'); |
NewerOlder