This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
| package org.vaadin.tatu; | |
| import com.vaadin.flow.component.Component; | |
| import com.vaadin.flow.component.Composite; | |
| import com.vaadin.flow.component.HasComponents; | |
| import com.vaadin.flow.component.HasSize; | |
| import com.vaadin.flow.component.html.Div; | |
| import com.vaadin.flow.component.html.H4; | |
| import com.vaadin.flow.component.html.Paragraph; | |
| import com.vaadin.flow.router.Route; |
| import javafx.scene.paint.Color; | |
| import java.io.BufferedReader; | |
| import java.io.IOException; | |
| import java.io.InputStream; | |
| import java.io.InputStreamReader; | |
| import java.io.StringWriter; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import java.util.Map; |
| # use ImageMagick convert | |
| # the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf | |
| convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf |
| // H/t to https://github.com/ethankhall/scripts/blob/master/gradle/find-file.gradle for the idea; | |
| // this re-written version actually works in modern Gradle and Android Gradle plugins. | |
| task findInDependencies { | |
| doLast { | |
| println() | |
| def resolvableConfigs = project.getConfigurations() | |
| .stream() | |
| .filter { it.isCanBeResolved() } |
This gist is now deprecated in favor of our official documentation: https://documentation.portainer.io/api/api-examples/ which contains up to date examples!
Please refer to the link above to get access to our updated API documentation and examples.
| docker logs nginx 2>&1 | grep "127." | |
| # ref: http://stackoverflow.com/questions/34724980/finding-a-string-in-docker-logs-of-container |
| /** | |
| * Returns a hash code for a string. | |
| * (Compatible to Java's String.hashCode()) | |
| * | |
| * The hash code for a string object is computed as | |
| * s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1] | |
| * using number arithmetic, where s[i] is the i th character | |
| * of the given string, n is the length of the string, | |
| * and ^ indicates exponentiation. | |
| * (The hash value of the empty string is zero.) |
Current version: 1.0.19 1.0.15 (as of 2018-12-10)
| Expression Utility Objects | |
| Besides these basic objects, Thymeleaf will offer us a set of utility objects that will help us perform common tasks in our expressions. | |
| #dates: utility methods for java.util.Date objects: formatting, component extraction, etc. | |
| #calendars: analogous to #dates, but for java.util.Calendar objects. | |
| #numbers: utility methods for formatting numeric objects. | |
| #strings: utility methods for String objects: contains, startsWith, prepending/appending, etc. | |
| #objects: utility methods for objects in general. | |
| #bools: utility methods for boolean evaluation. | |
| #arrays: utility methods for arrays. |
| sudo su | |
| echo deb https://apt.dockerproject.org/repo ubuntu-`cat /etc/lsb-release | grep DISTRIB_CODENAME | cut -d'=' -f2` main >> /etc/apt/sources.list.d/docker.list | |
| apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F76221572C52609D | |
| apt-get update | |
| apt-get purge lxc-docker* | |
| apt-get purge docker.io* | |
| apt-get install docker-engine | |
| exit |