As a developer you want to ping and access the webserver on your virtual machine. This is a very simple solution to enable the bridge to the guest VM.
- VirtualBox (latest version)
- A guest operation system (e.g. Ubuntu)
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
inAppBrowser | |
http://ngcordova.com/docs/plugins/inAppBrowser/ | |
Force download our open file Pdf: | |
var options = { | |
location: 'yes', | |
clearcache: 'yes' | |
}; |
// Get all users | |
var url = "http://localhost:8080/api/v1/users"; | |
var xhr = new XMLHttpRequest() | |
xhr.open('GET', url, true) | |
xhr.onload = function () { | |
var users = JSON.parse(xhr.responseText); | |
if (xhr.readyState == 4 && xhr.status == "200") { | |
console.table(users); | |
} else { | |
console.error(users); |
#region Hide System.Object inherited methods | |
/// <summary> | |
/// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>. | |
/// </summary> | |
/// <returns> | |
/// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false. | |
/// </returns> | |
/// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>. </param><filterpriority>2</filterpriority> | |
[EditorBrowsable(EditorBrowsableState.Never)] |
public static IList<TRes> ListAs<TRes>(this IQueryOver qry, TRes resultByExample) | |
{ | |
var ctor = typeof (TRes).GetConstructors().First(); | |
return qry.UnderlyingCriteria | |
.SetResultTransformer(Transformers.AliasToBeanConstructor(ctor)) | |
.List<TRes>(); | |
} | |
[Fact] | |
public void ListAs_Should_CastQueryOverResultToTypeSameAsSupliedExampleInstance() |
#region ICriteria async API | |
// Usage ICriteria.ListAsync<T>() | |
var customers = await session.CreateCriteria<Customer>().ListAsync<Customer>(); | |
// Usage ICriteria.UniqueResultAsync<T>() | |
var customer = await session | |
.CreateCriteria<Customer>() | |
.Add(Restrictions.Eq("Name", "Erdtsieck")) | |
.UniqueResultAsync<Customer>(); |
Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...
// see: https://github.com/chadoe/docker-cleanup-volumes
$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
When hosting our web applications, we often have one public IP
address (i.e., an IP address visible to the outside world)
using which we want to host multiple web apps. For example, one
may wants to host three different web apps respectively for
example1.com
, example2.com
, and example1.com/images
on
the same machine using a single IP address.
How can we do that? Well, the good news is Internet browsers
if ($request_uri = /) { | |
set $test A; | |
} | |
if ($host ~* teambox.com) { | |
set $test "${test}B"; | |
} | |
if ($http_cookie !~* "auth_token") { | |
set $test "${test}C"; |