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
<!-- 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> |
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
for i in *.jpg; do convert -auto-orient "$i" "$i"; done |
NewerOlder