[flex] {
box-sizing: border-box;
}
[flex] { flex: 1; } // == { flex: 1 1 0%; }
[flex="grow"] { flex: 1 1 100%; }
[flex="initial"] { flex: 0 1 auto; }
[flex="auto"] { flex: 1 1 auto; }
[flex="none"] { flex: 0 0 auto; }
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
ng.probe(getAllAngularRootElements()[0]).injector.view.root.ngModule._providers |
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 | |
# Thanks to MattJ at: | |
# http://www.brassmill.net/2015/10/using-the-aws-cli-with-roles-security-token-service-and-mfa/ | |
# | |
# User must have 'iam:GetUser' permission on themselves that doesn't require MFA | |
[ -z $1 ] && echo "Please enter your MFA code" && exit 1 | |
user=$(aws iam get-user \ |
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
//... | |
import { Router, NavigationEnd } from '@angular/router'; | |
//... | |
declare var ga : any; | |
//.. | |
constructor(private router : Router ) { | |
router.events.filter(e => e instanceof NavigationEnd).subscribe( (n:NavigationEnd) => { |
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
/** | |
* Service that manages subscriptions to mediaQuery changes. | |
* Subscribers will be notified of initialize, enter, and leave changes | |
* via ::attach() callback functions. | |
* | |
* @code: | |
* | |
* let self = $scope, | |
* layout_sm = "screen and (min-width:0px) and (max-width:599px)", |
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft
,elem.offsetTop
,elem.offsetWidth
,elem.offsetHeight
,elem.offsetParent
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
/* | |
A script to generate a Google BigQuery-complient JSON-schema from a JSON object. | |
Make sure the JSON object is complete before generating, null values will be skipped. | |
References: | |
https://cloud.google.com/bigquery/docs/data | |
https://cloud.google.com/bigquery/docs/personsDataSchema.json | |
https://gist.github.com/igrigorik/83334277835625916cd6 | |
... and a couple of visits to StackOverflow |
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
<!-- Required for on Android TV to receive Boot Completed events --> | |
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> | |
<!-- Need to Register the Recommendation Intent Service --> | |
<service android:name="us.nineworlds.serenity.core.services.OnDeckRecommendationIntentService" | |
android:enabled="true" android:exported="true"/> | |
<!-- The Receiver that actually responds to the Boot Completed event, needed | |
to start the recommendation service automatically when bootup has |
Install ElasticSearch and Java
1 wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.0.1.deb
2 sudo dpkg -i elasticsearch-1.0.1.deb
3 sudo update-rc.d elasticsearch defaults 95 10
4 sudo add-apt-repository ppa:webupd8team/java
5 sudo apt-get update
6 sudo apt-get install oracle-java7-installer
7 java -version
NewerOlder