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
<select > | |
<option th:each="year : ${#numbers.sequence(1900, #dates.year(#dates.createNow()))}" | |
th:value="${year}" th:text="${year}"> | |
</option> | |
</select> |
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
private static String paypalApiUrl = "https://api-3t.sandbox.paypal.com/nvp"; // remove sandbox. for production environment | |
private static NumberFormat paypalNumberFormat = new DecimalFormat("0.00", new DecimalFormatSymbols(Locale.US)); | |
public Map<String, String> paypalApi(Map<String, Object> params) throws ClientProtocolException, IOException { | |
HttpClient client = httpClientBuilder.build(); | |
HttpPost post = new HttpPost(paypalApiUrl); | |
List<NameValuePair> nvpParams = new ArrayList<NameValuePair>(); | |
for (Map.Entry<String, ?> e : params.entrySet()) { | |
nvpParams.add(new BasicNameValuePair(e.getKey(), e.getValue() instanceof Number | |
? paypalNumberFormat.format(e.getKey()) : e.getValue().toString())); |
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
{url:'stun:stun01.sipphone.com'}, | |
{url:'stun:stun.ekiga.net'}, | |
{url:'stun:stun.fwdnet.net'}, | |
{url:'stun:stun.ideasip.com'}, | |
{url:'stun:stun.iptel.org'}, | |
{url:'stun:stun.rixtelecom.se'}, | |
{url:'stun:stun.schlund.de'}, | |
{url:'stun:stun.l.google.com:19302'}, | |
{url:'stun:stun1.l.google.com:19302'}, | |
{url:'stun:stun2.l.google.com:19302'}, |
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
var ids = ["Msxml2.XMLHTTP", "Microsoft.XMLHTTP", "Msxml2.XMLHTTP.4.0"]; | |
if (typeof XMLHttpRequest === "undefined") { | |
for (var i = 0; i < ids.length; i++) { | |
try { | |
new ActiveXObject(ids[i]); | |
window.XMLHttpRequest = function() { | |
return new ActiveXObject(ids[i]); | |
}; | |
break; | |
} catch (e) {} |
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
package org.bar; | |
import org.geotools.referencing.GeodeticCalculator; | |
import java.awt.geom.Point2D; | |
/** | |
* How far is NY from London ? | |
*/ | |
public class DistanceTest { |
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
package com.stefisoft.webchat; | |
import java.util.HashSet; | |
import java.util.Set; | |
import javax.websocket.Endpoint; | |
import javax.websocket.server.ServerApplicationConfig; | |
import javax.websocket.server.ServerEndpointConfig; | |
import org.slf4j.Logger; |
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
language: node_js | |
node_js: | |
- stable | |
before_install: | |
- export CHROME_BIN=/usr/bin/google-chrome | |
- export DISPLAY=:99.0 | |
- sh -e /etc/init.d/xvfb start | |
- sudo apt-get update | |
- sudo apt-get install -y libappindicator1 fonts-liberation | |
- sudo apt-get upgrade libstdc++6 lsb-base |
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
# https://www.nginx.com/blog/nginx-caching-guide/ | |
proxy_cache_path /path/to/cache levels=1:2 keys_zone=my_cache:10m max_size=10g | |
inactive=60m use_temp_path=off; | |
server { | |
... | |
location / { | |
proxy_cache my_cache; |
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 groovy.sql.Sql | |
// more information at http://docs.groovy-lang.org/latest/html/api/groovy/sql/Sql.html | |
apply plugin: 'groovy' | |
apply plugin: 'eclipse' | |
apply plugin: 'maven' | |
repositories { mavenCentral() } | |
configurations { driver } |
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
version: '3' | |
services: | |
zk1: | |
image: zookeeper | |
restart: always | |
ports: | |
- "2181:2181" | |
environment: | |
ZOO_MY_ID: 1 | |
ZOO_SERVERS: server.1=zk1:2888:3888 |
OlderNewer