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
| // Ansi colors in Groovy | |
| // Author: Ted Vinke | |
| import static Ansi.* | |
| println color("BOLD", Ansi.BOLD) | |
| println color("ITALIC", Ansi.ITALIC) | |
| println color("UNDERLINE", Ansi.UNDERLINE) | |
| println color("BLINK", Ansi.BLINK) | |
| println color("RAPID_BLINK", Ansi.RAPID_BLINK) | |
| println color("REVERSE_VIDEO", Ansi.REVERSE_VIDEO) |
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
| import org.springframework.web.context.support.WebApplicationContextUtils | |
| class BootStrap { | |
| def init = { servletContext -> | |
| def springContext = WebApplicationContextUtils.getWebApplicationContext(servletContext) | |
| println "Initializing..." | |
| def service = springContext.getBean("notificationService") | |
| service.sendAdminNotification("[UP] started") | |
| } |
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
| class BootStrap { | |
| def init = { servletContext -> | |
| def springContext = WebApplicationContextUtils.getWebApplicationContext(servletContext) | |
| println "Initializing..." | |
| def service = springContext.getBean("notificationService") | |
| service.sendAdminNotification("[UP] started") | |
| } | |
| /** | |
| * Note: this is not guaranteed to be called by the servlet container |
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 {project}/platforms/android/CordovaLib/src/org/apache/cordova/engine/SystemWebViewEngine.java | |
| //Determine whether we're in debug or release mode, and turn on Debugging! | |
| ApplicationInfo appInfo = webView.getContext().getApplicationContext().getApplicationInfo(); | |
| if ((appInfo.flags & ApplicationInfo.FLAG_DEBUGGABLE) != 0 && | |
| android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.KITKAT) { | |
| enableRemoteDebugging(); | |
| } | |
| // .... |
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
| #add the repositories | |
| sudo apt-get update && sudo apt-get install -y curl | |
| curl http://files.freeswitch.org/repo/deb/debian/freeswitch_archive_g0.pub | sudo apt-key add - | |
| echo "deb http://files.freeswitch.org/repo/deb/freeswitch-1.6/ jessie main" | sudo tee /etc/apt/sources.list.d/freeswitch.list | |
| sudo apt-get update | |
| # install dependencies | |
| sudo apt-get install -y yasm nasm libyuv-dev libvpx2-dev liblua5.2-dev libvpx2-dev libvpx2 zlib1g-dev libspeex1 libopus-dev libsndfile-dev autoconf automake devscripts gawk g++ git-core 'libjpeg-dev|libjpeg62-turbo-dev' libncurses5-dev 'libtool-bin|libtool' make python-dev gawk pkg-config libtiff5-dev libperl-dev libgdbm-dev libdb-dev gettext libssl-dev libcurl4-openssl-dev libpcre3-dev libspeex-dev libspeexdsp-dev libsqlite3-dev libedit-dev libldns-dev libpq-dev yasm nasm unixodbc-dev unixodbc-bin unixodbc odbc-postgresql |
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
| <!-- Global site tag (gtag.js) - Google Analytics --> | |
| <script async src="https://www.googletagmanager.com/gtag/js?id=UA-XXXXX-Y"></script> | |
| <script> | |
| window.dataLayer = window.dataLayer || []; | |
| function gtag(){dataLayer.push(arguments);} | |
| gtag('js', new Date()); | |
| gtag('config', 'UA-XXXXX-Y', { | |
| 'page_path': location.pathname + location.search + location.hash | |
| }); |
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
| class Main { | |
| public static void testWithFloats() { | |
| System.out.println("testWithFloats\n"); | |
| float a = 0.1f; | |
| float b = 0.1f; | |
| float c = 0.1f; | |
| float d = a + b + c; | |
| float e = d * 3; |
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
| import org.vertx.groovy.core.Vertx | |
| class BootStrap { | |
| def init = { servletContext -> | |
| def vertx = Vertx.newVertx() | |
| def httpServer = vertx.createHttpServer() | |
| vertx.createSockJSServer(httpServer).installApp(prefix: '/events') { sock -> | |
| sock.dataHandler { buff -> | |
| sock << buff |
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
| server { | |
| listen 80; | |
| server_name xxx.com; | |
| location / { | |
| proxy_set_header X-Forwarded-Host $host; | |
| proxy_set_header X-Forwarded-Server $host; | |
| proxy_set_header Host $host; | |
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
| proxy_pass http://localhost:8080; | |
| proxy_read_timeout 1800; |
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
| apt-cache policy <packageName> |
NewerOlder