- Use
@ConfigurationProperties
and always get state from the bean. - The
Environment
can change at runtime and Spring Cloud does this for you usingRefreshEvent
. - Changes are propagated to beans in Spring Cloud in 2 ways (
@ConfigurationProperties
and@RefreshScope
). - If you care about the state of
@ConfigurationProperties
being consistent on concurrent access, put it or the consumer@Bean
in@RefreshScope
.
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
// Google Apps Script methods available to scripts | |
declare namespace google { | |
/** | |
* Methods available to Google Apps Script | |
*/ | |
namespace script { | |
interface IUrlLocation { | |
/** | |
* The string value of URL fragment after the # character, or an emptry string if no URL fragment is present |
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 | |
parent_short_id=$1 | |
parent_id=`docker inspect --format '{{.Id}}' $1` | |
get_kids() { | |
local parent_id=$1 | |
docker inspect --format='ID {{.Id}} PAR {{.Parent}}' $(docker images -a -q) | grep "PAR ${parent_id}" | sed -E "s/ID ([^ ]*) PAR ([^ ]*)/\1/g" | |
} | |
print_kids() { |
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 { Observable } from 'rxjs/Observable'; | |
// then patch import only needed operators: | |
import 'rxjs/add/operator/map'; | |
import 'rxjs/add/observable/from'; | |
const foo = Observable.from([1, 2, 3]); | |
foo.map(x => x * 2).subscribe(n => console.log(n)); |
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 | |
if [ "$1" = "-h" -o "$1" = "--help" ]; then cat <<EOF | |
appify v3.0.0 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh | |
Note that you cannot rename appified apps. If you want to give your app | |
a custom name, use the second argument: | |
`basename "$0"` my-script.sh "My App" |
Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.
This simple guide, walks through the what, when, why, and how of Cordova plugin development for Android.
Before start, understand their
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 jsinterop.annotations.JsFunction; | |
import jsinterop.annotations.JsMethod; | |
import jsinterop.annotations.JsType; | |
/** | |
* Created by bduisenov on 15/12/15. | |
*/ | |
public class Rx { | |
@FunctionalInterface |
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 Foundation | |
extension String | |
{ | |
var length: Int { | |
get { | |
return countElements(self) | |
} | |
} | |
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
// ### removeRecursive, copyRecursive when/promise compliant | |
// NodeJS: | |
// Delete a file or delete a DIR recursively | |
// be aware that this is a power full delete function | |
// so best is to check if the PATH given is really | |
// the path you want to DELETE ENTIRELY | |
// | |
// Copy DIR to another location recursively | |
// | |
// ### usage example |
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
// | |
// How to use: | |
// | |
// 1. Start node: | |
// node nodeproxy.js | |
// 2. Send a URL like this: | |
// http://localhost:8080/http://www.google.com | |
// | |
// Watch www.google.com come through your local HTTP proxy. | |
// |
NewerOlder