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
| <link rel="import" href="../google-map/google-map.html"> | |
| <link rel="import" href="../core-icons/core-icons.html"> | |
| <link rel="import" href="../core-icon/core-icon.html"> | |
| <link rel="import" href="../core-pages/core-pages.html"> | |
| <link rel="import" href="../paper-calculator/paper-calculator.html"> | |
| <polymer-element name="my-element"> | |
| <template> | |
| <style> |
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
| 1. separate scopes and use stric : | |
| (function() { "use strict"; function f(){...} })(); | |
| 2. js numbers ~= doubles. | |
| Thus: 0.1+0.2 = 0.30000000004... O_O | |
| And (0.3 + 0.2) + 0.1 != 0.3 + (0.2+0.1) | |
| So, to bypass the non-associativity, one should use a scale. E.g: myInt = myFloat*100000 and after the computation, divide by 100000 | |
| 3. There are 7 false var : false, 0, -0, "", NaN, null and undefined. Thus, "false" is true. | |
| + gives priority to string rather than int. It's overloaded for concatenation of strings. |
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
| == Clearfix hack == | |
| /* For modern browsers */ | |
| .cf:before, | |
| .cf:after { | |
| content:""; | |
| display:table; | |
| } | |
| .cf:after { |
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
| === FLOAT 9 RULES === | |
| 1- Floated elements are pushed to the edge of their containers, no further. | |
| 2- Any floated element will either appear next to or below a previous floated element. If the elements are floated left, the second element will appear to the right of the first. If they’re floated right, the second element will appear to the left of the first. | |
| 3- A left-floating box can’t be further right than a right-floating box. | |
| 4- Floated elements can’t go higher than their container’s top edge (this gets more complicated when collapsing margins are involved, see original rule). | |
| 5- A floated element can’t be higher than a previous block level or floated element. | |
| 6- A floated element can’t be higher than a previous line of inline elements. | |
| 7- One floated element next to another floated element can’t stick out past the edge of its container. | |
| 8- A floating box must be placed as high as possible. (No translation necessary) | |
| 9- A left-floating box must be put as far to the left as possible, a right-floating box as |
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
| == Random useful scriptshells == | |
| -- Copy all imgs in recursive dirs into the same -- | |
| find . -type f -name '*.jpg' -exec cp {} /home/new_dir/{} \; | |
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
| == JAR Inclusion == | |
| Please, don't just copy/past a jar file on eclipse to add the library. Right clic -> Build Path -> Add external jar. Sometimes, the Manifest.mf of the jar contains other dependencies required by the lib. |
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
| // in onCreate | |
| relative = (RelativeLayout) rootView.findViewById(R.id.relative_layout); | |
| relative.setOnClickListener(this); | |
| public void onClick(View v) { | |
| switch (v.getId()) { | |
| case R.id.btn_send: | |
| sendStory(); | |
| break; |
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
| == Hex format for opacity == | |
| 100% — FF | |
| 95% — F2 | |
| 90% — E6 | |
| 85% — D9 | |
| 80% — CC | |
| 75% — BF | |
| 70% — B3 | |
| 65% — A6 | |
| 60% — 99 |
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
| Toast.makeText(MainActivity.this, "Miam", Toast.LENGTH_SHORT).show(); |
NewerOlder